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:
Owen W. Taylor 2009-08-06 17:59:20 -04:00
parent ad5a9d8f8b
commit 59532ab0c7

View File

@ -221,7 +221,8 @@ get_memory_target (void)
return mem_total / 2; return mem_total / 2;
} }
/* Skip to the next line and discard what we read */ /* 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); fclose(f);