diff options
author | Timo Teras <timo.teras@iki.fi> | 2009-07-14 09:33:32 +0300 |
---|---|---|
committer | Timo Teras <timo.teras@iki.fi> | 2009-07-14 09:33:47 +0300 |
commit | 4562f44f9bac793b8397fdf35491da5d7ef815fa (patch) | |
tree | ee3b623f6ba2324909abdef26d41aabce7a9d434 /src/archive.c | |
parent | e69b81f5259f532d5f5ae9c0a0f9bbd81240fbaf (diff) | |
download | apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.tar.gz apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.tar.bz2 apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.tar.xz apk-tools-4562f44f9bac793b8397fdf35491da5d7ef815fa.zip |
bstream: make tokenizable and load index using bstream
some fixes on index reading code too.
Diffstat (limited to 'src/archive.c')
-rw-r--r-- | src/archive.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/archive.c b/src/archive.c index 6681b61..7e5a926 100644 --- a/src/archive.c +++ b/src/archive.c @@ -44,7 +44,12 @@ struct tar_header { char padding[12]; /* 500-512 */ }; -#define GET_OCTAL(s) apk_blob_uint(APK_BLOB_PTR_LEN(s, sizeof(s)), 8) +#define GET_OCTAL(s) get_octal(s, sizeof(s)) +static int get_octal(char *s, size_t l) +{ + apk_blob_t b = APK_BLOB_PTR_LEN(s, l); + return apk_blob_parse_uint(&b, 8); +} struct apk_tar_entry_istream { struct apk_istream is; |