Check the result of fgets() to deal with warn_unused_result
Some C library versions have __attribute__((warn_unused_result)) on fgets(). We really don't care since we are just throwing the data away, but check the result anyways.
This commit is contained in:
parent
ad5a9d8f8b
commit
59532ab0c7
@ -221,7 +221,8 @@ get_memory_target (void)
|
||||
return mem_total / 2;
|
||||
}
|
||||
/* Skip to the next line and discard what we read */
|
||||
fgets(line_buffer, sizeof(line_buffer), f);
|
||||
if (fgets(line_buffer, sizeof(line_buffer), f) == NULL)
|
||||
break;
|
||||
}
|
||||
|
||||
fclose(f);
|
||||
|
Loading…
Reference in New Issue
Block a user