~sircmpwn/hare-compress

6c36c07ff8a6139ad294e3fbb592e0e17804a18b — Alexey Yerin 9 months ago da36350
Correct FCHECK condition

Since buf[0] is a u8, using << 8 will turn it into 0.
1 files changed, 1 insertions(+), 1 deletions(-)

M compress/zlib/reader.ha
M compress/zlib/reader.ha => compress/zlib/reader.ha +1 -1
@@ 136,7 136,7 @@ export fn decompress(src: io::handle) (reader | io::error) = {
	if ((buf[0] & CINFO) >> 4 > 7) {
		return wraperror(decompress_err::HEADER);
	};
	if ((buf[0] << 8 | buf[1]) % 31 != 0) {
	if ((buf[0]: u16 << 8 | buf[1]) % 31 != 0) {
		// Invalid FCHECK
		return wraperror(decompress_err::HEADER);
	};