From 5e70db6137a51d3752ac63ac12fdacbdb8e23bd7 Mon Sep 17 00:00:00 2001 From: jmtcsngr Date: Thu, 30 May 2024 11:19:46 +0100 Subject: [PATCH] fix compiler warning in t_read2tags catch and check return fgets --- test/t_read2tags.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/test/t_read2tags.c b/test/t_read2tags.c index 4c2dbb3..6db2254 100644 --- a/test/t_read2tags.c +++ b/test/t_read2tags.c @@ -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++;