You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The code in src/drive.c that calls fread(3) treats its return (a size_t) as if it were the return from read(2) (a ssize_t).
For fread(3) the return value will never be negative. Instead, any time the return value is less than the amount requested, you need to check for both failure and EOF using ferror(3) and feof(3) respectively.
The text was updated successfully, but these errors were encountered:
The code in src/drive.c that calls
fread(3)
treats its return (asize_t
) as if it were the return fromread(2)
(assize_t
).For
fread(3)
the return value will never be negative. Instead, any time the return value is less than the amount requested, you need to check for both failure and EOF usingferror(3)
andfeof(3)
respectively.The text was updated successfully, but these errors were encountered: