1
0
Fork 0
mirror of https://git.tukaani.org/xz.git synced 2024-04-04 12:36:23 +02:00

xz: Fix xz on EBCDIC systems.

Thanks to Chris Donawa.
This commit is contained in:
Lasse Collin 2011-11-03 17:07:22 +02:00
parent 4ac4923f47
commit 74d2bae4d3

View file

@ -327,7 +327,10 @@ coder_set_compression_settings(void)
static bool static bool
is_format_xz(void) is_format_xz(void)
{ {
return strm.avail_in >= 6 && memcmp(in_buf.u8, "\3757zXZ", 6) == 0; // Specify the magic as hex to be compatible with EBCDIC systems.
static const uint8_t magic[6] = { 0xFD, 0x37, 0x7A, 0x58, 0x5A, 0x00 };
return strm.avail_in >= sizeof(magic)
&& memcmp(in_buf.u8, magic, sizeof(magic)) == 0;
} }