diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2010-06-26 05:01:16 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2010-06-26 05:01:16 +0200 |
commit | 894fa0ad62924bcfc2d37e045e36d25ad5784888 (patch) | |
tree | 0ebcf614981f9b2154ce35d663b76fc9526699f1 | |
parent | 63144be7eae8757b0e0d81ff6fa8adb0b26ff7c1 (diff) | |
download | busybox-w32-894fa0ad62924bcfc2d37e045e36d25ad5784888.tar.gz busybox-w32-894fa0ad62924bcfc2d37e045e36d25ad5784888.tar.bz2 busybox-w32-894fa0ad62924bcfc2d37e045e36d25ad5784888.zip |
fix breakage in compressed file detection
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | archival/rpm2cpio.c | 4 | ||||
-rw-r--r-- | libbb/read_printf.c | 4 |
2 files changed, 4 insertions, 4 deletions
diff --git a/archival/rpm2cpio.c b/archival/rpm2cpio.c index 1c67dcc6e..1f67fa887 100644 --- a/archival/rpm2cpio.c +++ b/archival/rpm2cpio.c | |||
@@ -75,7 +75,7 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv) | |||
75 | } magic; | 75 | } magic; |
76 | IF_DESKTOP(long long) int FAST_FUNC (*unpack)(int src_fd, int dst_fd); | 76 | IF_DESKTOP(long long) int FAST_FUNC (*unpack)(int src_fd, int dst_fd); |
77 | 77 | ||
78 | xread(rpm_fd, magic.b16, sizeof(magic.b16)); | 78 | xread(rpm_fd, magic.b16, sizeof(magic.b16[0])); |
79 | if (magic.b16[0] == GZIP_MAGIC) { | 79 | if (magic.b16[0] == GZIP_MAGIC) { |
80 | unpack = unpack_gz_stream; | 80 | unpack = unpack_gz_stream; |
81 | } else | 81 | } else |
@@ -89,7 +89,7 @@ int rpm2cpio_main(int argc UNUSED_PARAM, char **argv) | |||
89 | ) { | 89 | ) { |
90 | /* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */ | 90 | /* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */ |
91 | /* More info at: http://tukaani.org/xz/xz-file-format.txt */ | 91 | /* More info at: http://tukaani.org/xz/xz-file-format.txt */ |
92 | xread(rpm_fd, magic.b32, sizeof(magic.b32)); | 92 | xread(rpm_fd, magic.b32, sizeof(magic.b32[0])); |
93 | if (magic.b32[0] != XZ_MAGIC2) | 93 | if (magic.b32[0] != XZ_MAGIC2) |
94 | goto no_magic; | 94 | goto no_magic; |
95 | /* unpack_xz_stream wants fd at position 0 */ | 95 | /* unpack_xz_stream wants fd at position 0 */ |
diff --git a/libbb/read_printf.c b/libbb/read_printf.c index 53f528f5a..3aee075c6 100644 --- a/libbb/read_printf.c +++ b/libbb/read_printf.c | |||
@@ -265,7 +265,7 @@ void FAST_FUNC setup_unzip_on_fd(int fd /*, int fail_if_not_detected*/) | |||
265 | 265 | ||
266 | /* .gz and .bz2 both have 2-byte signature, and their | 266 | /* .gz and .bz2 both have 2-byte signature, and their |
267 | * unpack_XXX_stream wants this header skipped. */ | 267 | * unpack_XXX_stream wants this header skipped. */ |
268 | xread(fd, magic.b16, sizeof(magic.b16)); | 268 | xread(fd, magic.b16, sizeof(magic.b16[0])); |
269 | if (ENABLE_FEATURE_SEAMLESS_GZ | 269 | if (ENABLE_FEATURE_SEAMLESS_GZ |
270 | && magic.b16[0] == GZIP_MAGIC | 270 | && magic.b16[0] == GZIP_MAGIC |
271 | ) { | 271 | ) { |
@@ -292,7 +292,7 @@ void FAST_FUNC setup_unzip_on_fd(int fd /*, int fail_if_not_detected*/) | |||
292 | /* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */ | 292 | /* .xz signature: 0xfd, '7', 'z', 'X', 'Z', 0x00 */ |
293 | /* More info at: http://tukaani.org/xz/xz-file-format.txt */ | 293 | /* More info at: http://tukaani.org/xz/xz-file-format.txt */ |
294 | offset = -6; | 294 | offset = -6; |
295 | xread(fd, magic.b32, sizeof(magic.b32)); | 295 | xread(fd, magic.b32, sizeof(magic.b32[0])); |
296 | if (magic.b32[0] == XZ_MAGIC2) { | 296 | if (magic.b32[0] == XZ_MAGIC2) { |
297 | # if BB_MMU | 297 | # if BB_MMU |
298 | xformer = unpack_xz_stream; | 298 | xformer = unpack_xz_stream; |