Skip to content

Commit

Permalink
Fix coverity issue
Browse files Browse the repository at this point in the history
** CID 1598412:  Error handling issues  (CHECKED_RETURN)
/src/parse.c: 273 in main()

________________________________________________________________________________________________________
*** CID 1598412:  Error handling issues  (CHECKED_RETURN)
/src/parse.c: 273 in main()
267                     if (0 == s && ferror(fd))
268                     {
269                             perror("fread " OUTPUT_FILENAME);
270                             return -1;
271                     }
272                     fwrite(buff, s, 1, stdout);
>>>     CID 1598412:  Error handling issues  (CHECKED_RETURN)
>>>     Calling "gzfwrite(buff, s, 1UL, zfd)" without checking return value. This library function may fail and return an error code.
273                     gzfwrite(buff, s, 1, zfd);
274             }
275             fclose(fd);
276             gzclose(zfd);
277
278             /* remove now useless output.txt */
  • Loading branch information
LudovicRousseau committed May 24, 2024
1 parent 09c8471 commit b12284b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/parse.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ int main(int argc, char *argv[])
return -1;
}
fwrite(buff, s, 1, stdout);
gzfwrite(buff, s, 1, zfd);
(void)gzfwrite(buff, s, 1, zfd);
}
fclose(fd);
gzclose(zfd);
Expand Down

0 comments on commit b12284b

Please sign in to comment.