aboutsummaryrefslogtreecommitdiff
path: root/archival/libarchive
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2011-02-06 20:01:11 +0100
committerDenys Vlasenko <vda.linux@googlemail.com>2011-02-06 20:01:11 +0100
commitaef441cb4d567da5575c498141b21eb38dc3fdaf (patch)
treef99a2ebecd77c614f243c4df859ee40f7281f9bc /archival/libarchive
parentca18e25525267736e7e919987c50569f27d70d36 (diff)
downloadbusybox-aef441cb4d567da5575c498141b21eb38dc3fdaf.tar.gz
tar: fix a bug where autodetection messes up -z on extract
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'archival/libarchive')
-rw-r--r--archival/libarchive/get_header_tar_gz.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/archival/libarchive/get_header_tar_gz.c b/archival/libarchive/get_header_tar_gz.c
index b09f8691c..889fed0d9 100644
--- a/archival/libarchive/get_header_tar_gz.c
+++ b/archival/libarchive/get_header_tar_gz.c
@@ -9,7 +9,7 @@
char FAST_FUNC get_header_tar_gz(archive_handle_t *archive_handle)
{
#if BB_MMU
- unsigned char magic[2];
+ uint16_t magic;
#endif
/* Can't lseek over pipes */
@@ -21,7 +21,7 @@ char FAST_FUNC get_header_tar_gz(archive_handle_t *archive_handle)
#if BB_MMU
xread(archive_handle->src_fd, &magic, 2);
/* Can skip this check, but error message will be less clear */
- if ((magic[0] != 0x1f) || (magic[1] != 0x8b)) {
+ if (magic != GZIP_MAGIC) {
bb_error_msg_and_die("invalid gzip magic");
}
#endif