diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2023-05-03 02:51:03 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2023-05-03 02:51:03 (EDT) |
commit | 142fe4b1ac4b84297c2c1498765ae3813146c858 (patch) | |
tree | fa2bbfd8a2b014b9e25c3668e94b083ba6a032b3 | |
parent | a1abbf884676ebbdf6f85947b7f0fc5c6915782e (diff) |
ustar: Treat octets as unsigned in chksum
Per POSIX.
Complement of commit 619f09be066777b8296acf93bd6b51771ca64bd2.
-rw-r--r-- | src/ustar.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ustar.c b/src/ustar.c index e4d9aca..f67c0e9 100644 --- a/src/ustar.c +++ b/src/ustar.c @@ -76,11 +76,11 @@ opkg_opk_ustar_init(struct opkg_opk_gzip *gzip) static int _opkg_opk_ustar_next(struct opkg_opk_ustar *ustar) { - char *end; - uint32_t chksum_got; - uint32_t chksum_exp; - size_t i; - char *header_uc; + char *end; + uint32_t chksum_got; + uint32_t chksum_exp; + size_t i; + unsigned char *header_uc; /* Seek through data records until next header record. */ while (ustar->data_size_remaining > 0) { @@ -123,7 +123,7 @@ _opkg_opk_ustar_next(struct opkg_opk_ustar *ustar) for (i = 0; i < sizeof(ustar->header.chksum); ++i) { ustar->header.chksum[i] = ' '; } - header_uc = (char *) &ustar->header; + header_uc = (unsigned char *) &ustar->header; for (i = 0; i < OPKG_OPK_USTAR_RECORD_SIZE; ++i) { chksum_exp += header_uc[i]; } |