makes sure timeppassed is not infinitely increased

This commit is contained in:
celso 2022-11-20 13:19:45 -03:00
parent e6160e1664
commit e80c7c3807
1 changed files with 3 additions and 1 deletions

View File

@ -183,7 +183,9 @@ int main(int argc, char** argv){
FILE* curtempfile; FILE* curtempfile;
/* from here onwards an infinite while loop should start */ /* from here onwards an infinite while loop should start */
while((curtempfile = fopen(CURTEMPPATH, "r")) != NULL){ while((curtempfile = fopen(CURTEMPPATH, "r")) != NULL){
timepassed++; if (timepassed < 61){
timepassed++;
}
char* char_temperature = malloc(sizeof(char) * 8); char* char_temperature = malloc(sizeof(char) * 8);
getfilec(curtempfile, char_temperature); getfilec(curtempfile, char_temperature);
newlinetonullbyte(char_temperature); newlinetonullbyte(char_temperature);