From e80c7c38071be0ce71d853f02d86f315a567e638 Mon Sep 17 00:00:00 2001 From: celso Date: Sun, 20 Nov 2022 13:19:45 -0300 Subject: [PATCH] makes sure timeppassed is not infinitely increased --- src/homemade_speedstep.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/homemade_speedstep.c b/src/homemade_speedstep.c index 5711f7d..34286e5 100644 --- a/src/homemade_speedstep.c +++ b/src/homemade_speedstep.c @@ -183,7 +183,9 @@ int main(int argc, char** argv){ FILE* curtempfile; /* from here onwards an infinite while loop should start */ while((curtempfile = fopen(CURTEMPPATH, "r")) != NULL){ - timepassed++; + if (timepassed < 61){ + timepassed++; + } char* char_temperature = malloc(sizeof(char) * 8); getfilec(curtempfile, char_temperature); newlinetonullbyte(char_temperature);