diff options
Diffstat (limited to 'archival/libunarchive/unpack_ar_archive.c')
-rw-r--r-- | archival/libunarchive/unpack_ar_archive.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/archival/libunarchive/unpack_ar_archive.c b/archival/libunarchive/unpack_ar_archive.c index dc2eec223..300d10e48 100644 --- a/archival/libunarchive/unpack_ar_archive.c +++ b/archival/libunarchive/unpack_ar_archive.c | |||
@@ -5,16 +5,17 @@ | |||
5 | 5 | ||
6 | #include "libbb.h" | 6 | #include "libbb.h" |
7 | #include "unarchive.h" | 7 | #include "unarchive.h" |
8 | #include "ar.h" | ||
8 | 9 | ||
9 | void FAST_FUNC unpack_ar_archive(archive_handle_t *ar_archive) | 10 | void FAST_FUNC unpack_ar_archive(archive_handle_t *ar_archive) |
10 | { | 11 | { |
11 | char magic[7]; | 12 | char magic[7]; |
12 | 13 | ||
13 | xread(ar_archive->src_fd, magic, 7); | 14 | xread(ar_archive->src_fd, magic, AR_MAGIC_LEN); |
14 | if (strncmp(magic, "!<arch>", 7) != 0) { | 15 | if (strncmp(magic, AR_MAGIC, AR_MAGIC_LEN) != 0) { |
15 | bb_error_msg_and_die("invalid ar magic"); | 16 | bb_error_msg_and_die("invalid ar magic"); |
16 | } | 17 | } |
17 | ar_archive->offset += 7; | 18 | ar_archive->offset += AR_MAGIC_LEN; |
18 | 19 | ||
19 | while (get_header_ar(ar_archive) == EXIT_SUCCESS) | 20 | while (get_header_ar(ar_archive) == EXIT_SUCCESS) |
20 | continue; | 21 | continue; |