- unzip_read(src_fd, zip_header.raw, 26);
-#if BB_BIG_ENDIAN
- zip_header.formated.version = __swap16(zip_header.formated.version);
- zip_header.formated.flags = __swap16(zip_header.formated.flags);
- zip_header.formated.method = __swap16(zip_header.formated.method);
- zip_header.formated.modtime = __swap16(zip_header.formated.modtime);
- zip_header.formated.moddate = __swap16(zip_header.formated.moddate);
- zip_header.formated.crc32 = __swap32(zip_header.formated.crc32);
- zip_header.formated.cmpsize = __swap32(zip_header.formated.cmpsize);
- zip_header.formated.ucmpsize = __swap32(zip_header.formated.ucmpsize);
- zip_header.formated.filename_len = __swap16(zip_header.formated.filename_len);
- zip_header.formated.extra_len = __swap16(zip_header.formated.extra_len);
-#endif /* BB_BIG_ENDIAN */
- if ((zip_header.formated.method != 0) && (zip_header.formated.method != 8)) {
- bb_error_msg_and_die("Unsupported compression method %d", zip_header.formated.method);
+ xread(src_fd, zip_header.raw, 26);
+ zip_header.formatted.version = SWAP_LE32(zip_header.formatted.version);
+ zip_header.formatted.flags = SWAP_LE32(zip_header.formatted.flags);
+ zip_header.formatted.method = SWAP_LE32(zip_header.formatted.method);
+ zip_header.formatted.modtime = SWAP_LE32(zip_header.formatted.modtime);
+ zip_header.formatted.moddate = SWAP_LE32(zip_header.formatted.moddate);
+ zip_header.formatted.crc32 = SWAP_LE32(zip_header.formatted.crc32);
+ zip_header.formatted.cmpsize = SWAP_LE32(zip_header.formatted.cmpsize);
+ zip_header.formatted.ucmpsize = SWAP_LE32(zip_header.formatted.ucmpsize);
+ zip_header.formatted.filename_len = SWAP_LE32(zip_header.formatted.filename_len);
+ zip_header.formatted.extra_len = SWAP_LE32(zip_header.formatted.extra_len);
+ if ((zip_header.formatted.method != 0) && (zip_header.formatted.method != 8)) {
+ bb_error_msg_and_die("unsupported compression method %d", zip_header.formatted.method);