mirror of
git://git.musl-libc.org/musl
synced 2025-02-02 12:01:40 +00:00
getsubopt: don't include leading = in value string
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>
This commit is contained in:
parent
5a9c8c05a5
commit
aa71ec3db8
@ -15,7 +15,7 @@ int getsubopt(char **opt, char *const *keys, char **val)
|
|||||||
size_t l = strlen(keys[i]);
|
size_t l = strlen(keys[i]);
|
||||||
if (strncmp(keys[i], s, l)) continue;
|
if (strncmp(keys[i], s, l)) continue;
|
||||||
if (s[l] == '=')
|
if (s[l] == '=')
|
||||||
*val = s + l;
|
*val = s + l + 1;
|
||||||
else if (s[l]) continue;
|
else if (s[l]) continue;
|
||||||
return i;
|
return i;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user