In commit:
d37d63d symbols: prefix static symbols with their source file names
An unchecked fgets was added. This causes a compile error at least
on ubuntu utopic:
symbols.c: In function 'read_symbol':
symbols.c:181:3: error: ignoring return value of 'fgets', declared with
attribute warn_unused_result [-Werror=unused-result]
fgets(str, 500, in); /* discard rest of line */
^
Paper over the warning by checking the return value in the if statement.
Signed-off-by: Riku Voipio <riku.voipio@linaro.org>
Acked-by: Jan Beulich <jbeulich@suse.com>
rc = 0;
skip_tail:
- if (input_format == fmt_sysv)
- fgets(str, 500, in); /* discard rest of line */
+ if ((input_format == fmt_sysv) && fgets(str, 500, in) == NULL)
+ /* ignore errors while discarding rest of line */;
return rc;
}