Skip to content

Commit

Permalink
sys/fs: fix fs_fopen return null check
Browse files Browse the repository at this point in the history
Not very likely to happen (since errno must be zero) but
fixes clang-analyze warnings
  • Loading branch information
sreimers committed Dec 20, 2024
1 parent a6825bd commit 6597dec
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/sys/fs.c
Original file line number Diff line number Diff line change
Expand Up @@ -270,7 +270,7 @@ int fs_fread(struct mbuf **mbp, const char *path)
return EINVAL;

err = fs_fopen(&f, path, "r");
if (err) {
if (err || !f) {
DEBUG_WARNING("Could not open file '%s'\n", path);
return err;
}
Expand Down

0 comments on commit 6597dec

Please sign in to comment.