cmph: Handle fgets() return value

Newer versions of the GNU libc have started to warn if the result of the
call is unused.
This commit is contained in:
Emmanuele Bassi 2022-01-11 15:59:43 +00:00
parent 4398e1fde2
commit 3d999b47e5

View File

@ -155,7 +155,7 @@ static cmph_uint32 count_nlfile_keys(FILE *fd)
while(1)
{
char buf[BUFSIZ];
fgets(buf, BUFSIZ, fd);
if (fgets(buf, BUFSIZ, fd) == NULL) break;
if (feof(fd)) break;
if (buf[strlen(buf) - 1] != '\n') continue;
++count;