Skip to content

Commit

Permalink
fix compiler warning in t_read2tags
Browse files Browse the repository at this point in the history
catch and check return fgets
  • Loading branch information
jmtcsngr committed May 30, 2024
1 parent e7ea911 commit 5e70db6
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion test/t_read2tags.c
Original file line number Diff line number Diff line change
Expand Up @@ -344,7 +344,11 @@ void checkFiles(char *gotfile, char *expectfile, int verbose)
char expline[1024];

while (fgets(getline, 1023, getfp) > 0) {
fgets(expline, 1023, expfp);
if ((fgets(expline, 1023, expfp)) == NULL) {
if (verbose) fprintf(stderr, "failed to read from expfp\n");
failure++;
break;
}
if (strcmp(getline,expline) != 0) {
fprintf(stderr, "Expected: %sFound : %s\n", expline, getline);
failure++;
Expand Down

0 comments on commit 5e70db6

Please sign in to comment.