summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkientzle <kientzle@FreeBSD.org>2008-01-15 04:56:48 +0000
committerkientzle <kientzle@FreeBSD.org>2008-01-15 04:56:48 +0000
commit0454875168679c2685d654c75bc3728da2da422d (patch)
tree4a6445a8f7efc01b10688188b74c937fed2c1949
parentdea5febad5ccd336c3404daa328a8dc89f9347c6 (diff)
downloadFreeBSD-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.c8
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);
}
OpenPOWER on IntegriCloud