diff options
author | kientzle <kientzle@FreeBSD.org> | 2008-01-15 04:56:48 +0000 |
---|---|---|
committer | kientzle <kientzle@FreeBSD.org> | 2008-01-15 04:56:48 +0000 |
commit | 0454875168679c2685d654c75bc3728da2da422d (patch) | |
tree | 4a6445a8f7efc01b10688188b74c937fed2c1949 | |
parent | dea5febad5ccd336c3404daa328a8dc89f9347c6 (diff) | |
download | FreeBSD-src-0454875168679c2685d654c75bc3728da2da422d.zip FreeBSD-src-0454875168679c2685d654c75bc3728da2da422d.tar.gz |
Support uppercase hex digits in cpio archives.
Thanks to: Joshua Kwan
MFC after: 7 days
-rw-r--r-- | lib/libarchive/archive_read_support_format_cpio.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/lib/libarchive/archive_read_support_format_cpio.c b/lib/libarchive/archive_read_support_format_cpio.c index 5034764..5cb5fe6 100644 --- a/lib/libarchive/archive_read_support_format_cpio.c +++ b/lib/libarchive/archive_read_support_format_cpio.c @@ -321,10 +321,12 @@ static int is_hex(const char *p, size_t len) { while (len-- > 0) { - if (*p < '0' || (*p > '9' && *p < 'a') || *p > 'f') { + if ((*p >= '0' && *p <= '9') + || (*p >= 'a' && *p <= 'f') + || (*p >= 'A' && *p <= 'F')) + ++p; + else return (0); - } - ++p; } return (1); } |