projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a9c8c0
)
getsubopt: don't include leading = in value string
author
Steven Barth
<cyrus@openwrt.org>
Tue, 18 Aug 2015 09:06:04 +0000
(11:06 +0200)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 21 Aug 2015 05:29:10 +0000
(
01:29
-0400)
getsubopt incorrectly returns the delimiting = in the value string,
this patch fixes it by increasing the pointer position by one.
Signed-off-by: Steven Barth <cyrus@openwrt.org>
src/misc/getsubopt.c
patch
|
blob
|
history
diff --git
a/src/misc/getsubopt.c
b/src/misc/getsubopt.c
index dac9bf9eafd82670dab6685065e234eb50524a09..53ee9573f2fce5430b13424dfabb77f9253d0b97 100644
(file)
--- a/
src/misc/getsubopt.c
+++ b/
src/misc/getsubopt.c
@@
-15,7
+15,7
@@
int getsubopt(char **opt, char *const *keys, char **val)
size_t l = strlen(keys[i]);
if (strncmp(keys[i], s, l)) continue;
if (s[l] == '=')
- *val = s + l;
+ *val = s + l
+ 1
;
else if (s[l]) continue;
return i;
}