X-Git-Url: https://git.librecmc.org/?p=oweals%2Fopkg-lede.git;a=blobdiff_plain;f=libopkg%2Ffile_util.c;h=7e955edd1635f7f0849d3ac1c024990ce20e6042;hp=61ff736cd2c82a224cb10f48d14532b8224bd792;hb=c09fe20;hpb=80d161eb5b95ceb51db989196405eaa00950e03b diff --git a/libopkg/file_util.c b/libopkg/file_util.c index 61ff736..7e955ed 100644 --- a/libopkg/file_util.c +++ b/libopkg/file_util.c @@ -235,7 +235,7 @@ char *checksum_hex2bin(const char *src, size_t *len) { size_t slen; unsigned char *p; - const unsigned char *s = (unsigned char *)src; + const unsigned char *s; static unsigned char buf[32]; if (!src) { @@ -253,7 +253,7 @@ char *checksum_hex2bin(const char *src, size_t *len) return NULL; } - for (p = buf, *len = 0; + for (s = (unsigned char *)src, p = buf, *len = 0; slen > 0 && isxdigit(s[0]) && isxdigit(s[1]); slen--, s += 2, (*len)++) *p++ = hex2bin(s[0]) * 16 + hex2bin(s[1]);