projects
/
project
/
opkg-lede.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
80d161e
)
libopkg: fix skipping of leading whitespace when parsing checksums
author
Jo-Philipp Wich
<jo@mein.io>
Sat, 25 Jan 2020 12:57:01 +0000
(13:57 +0100)
committer
Jo-Philipp Wich
<jo@mein.io>
Sat, 25 Jan 2020 12:57:01 +0000
(13:57 +0100)
Signed-off-by: Jo-Philipp Wich <jo@mein.io>
libopkg/file_util.c
patch
|
blob
|
history
diff --git
a/libopkg/file_util.c
b/libopkg/file_util.c
index 61ff736cd2c82a224cb10f48d14532b8224bd792..7e955edd1635f7f0849d3ac1c024990ce20e6042 100644
(file)
--- 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]);