Skip to content

utils.hpp length check #44

@RPGillespie6

Description

@RPGillespie6

utils.hpp contains the following length check for is_compressed:

return size > 2 && ...

However, it only uses the first two bytes. I would vote that length check should be return size >= 2 && ...

This would allow me to do something like:

        char gzipHeader[2];
        file.read(gzipHeader, 2);
        file.seekg(0, ios::beg); // rewind

        if (gzip::is_compressed(gzipHeader, 2))
            // do something...

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions