Index: src/xz/coder.c |
=================================================================== |
--- src/xz/coder.c (revision 87706) |
+++ src/xz/coder.c (working copy) |
@@ -284,7 +284,10 @@ |
static bool |
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; |
} |