summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorptrcnull <git@ptrcnull.me>2022-02-20 17:05:42 +0100
committerTimo Teräs <timo.teras@iki.fi>2022-02-21 08:26:20 +0000
commitb576f0828443f2b729aefb8d2303ad75e9908c66 (patch)
tree284e68ed31a8998c74573cff54ddac2c5e24c852
parent3ad4d6bed139272fd9a775165ed25ed45ffa24fb (diff)
downloadapk-tools-b576f0828443f2b729aefb8d2303ad75e9908c66.tar.gz
apk-tools-b576f0828443f2b729aefb8d2303ad75e9908c66.tar.bz2
apk-tools-b576f0828443f2b729aefb8d2303ad75e9908c66.tar.xz
apk-tools-b576f0828443f2b729aefb8d2303ad75e9908c66.zip
tar: allow for space as numeric field terminator
-rw-r--r--src/tar.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tar.c b/src/tar.c
index e682dda..426a924 100644
--- a/src/tar.c
+++ b/src/tar.c
@@ -42,7 +42,7 @@ static unsigned int get_octal(char *s, size_t l, int *r)
{
apk_blob_t b = APK_BLOB_PTR_LEN(s, l);
unsigned int val = apk_blob_pull_uint(&b, 8);
- while (b.len >= 1 && b.ptr[0] == 0) b.ptr++, b.len--;
+ while (b.len >= 1 && (b.ptr[0] == 0 || b.ptr[0] == 0x20)) b.ptr++, b.len--;
if (b.len != 0) *r = -APKE_V2PKG_FORMAT;
return val;
}