Skip to content

src/drive.c uses fread(3) like it’s read(2) #3

@eschaton

Description

@eschaton

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions