Skip to content

Commit

Permalink
utils: use ferror and not math to check file handler for error.
Browse files Browse the repository at this point in the history
Signed-off-by: Phillip Whelan <[email protected]>
  • Loading branch information
pwhelan authored and edsiper committed Sep 4, 2023
1 parent 6a41f19 commit 1a1280b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/flb_utils.c
Original file line number Diff line number Diff line change
Expand Up @@ -1303,7 +1303,7 @@ int flb_utils_read_file(char *path, char **out_buf, size_t *out_size)

bytes = fread(buf, st.st_size, 1, fp);
if (bytes < 1) {
if (bytes < 0) {
if (ferror(fp)) {
flb_errno();
}
flb_free(buf);
Expand Down

0 comments on commit 1a1280b

Please sign in to comment.