Fixes bug 3482222 filed in the bug tracker.

This commit is contained in:
Fabiano C. Botelho
2013-04-16 00:50:24 -07:00
parent 9e434d41d0
commit c1a9eb164e
2 changed files with 7 additions and 7 deletions

View File

@@ -157,11 +157,11 @@ static cmph_uint32 count_nlfile_keys(FILE *fd)
{
char buf[BUFSIZ];
ptr = fgets(buf, BUFSIZ, fd);
if (feof(fd)) break;
if (ferror(fd) || ptr == NULL) {
perror("Error reading input file");
return 0;
}
if (feof(fd)) break;
if (ferror(fd) || ptr == NULL) {
perror("Error reading input file");
return 0;
}
if (buf[strlen(buf) - 1] != '\n') continue;
++count;
}