diff options
author | Samuel Mendoza-Jonas <sam@mendozajonas.com> | 2018-05-14 14:29:15 +1000 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2018-05-14 10:46:00 +0200 |
commit | 43b9235f66aa56bb884c13443d9e7d56003b5c36 (patch) | |
tree | faaf393bf9a5d1328b159ee1e123fd99e1ff2b98 | |
parent | 254e47372f77ea1070be6dbb44b5c45770115a07 (diff) | |
download | busybox-w32-43b9235f66aa56bb884c13443d9e7d56003b5c36.tar.gz busybox-w32-43b9235f66aa56bb884c13443d9e7d56003b5c36.tar.bz2 busybox-w32-43b9235f66aa56bb884c13443d9e7d56003b5c36.zip |
udhcp: fix use of trim() in udhcp_str2optset()
trim() modifies the string in place if needed and returns a pointer to
the end of the resulting string. Update udhcp_str2optset() so it no
longer sets the value of 'val' to the return value of trim().
Signed-off-by: Samuel Mendoza-Jonas <sam@mendozajonas.com>
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
-rw-r--r-- | networking/udhcp/common.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/networking/udhcp/common.c b/networking/udhcp/common.c index fbf9c6878..b7c04da73 100644 --- a/networking/udhcp/common.c +++ b/networking/udhcp/common.c | |||
@@ -489,9 +489,10 @@ int FAST_FUNC udhcp_str2optset(const char *const_str, void *arg, const struct dh | |||
489 | int length; | 489 | int length; |
490 | char *val; | 490 | char *val; |
491 | 491 | ||
492 | if (optflag->flags == OPTION_BIN) | 492 | if (optflag->flags == OPTION_BIN) { |
493 | val = trim(strtok(NULL, "")); /* do not split "'q w e'" */ | 493 | val = strtok(NULL, ""); /* do not split "'q w e'" */ |
494 | else | 494 | trim(val); |
495 | } else | ||
495 | val = strtok(NULL, ", \t"); | 496 | val = strtok(NULL, ", \t"); |
496 | if (!val) | 497 | if (!val) |
497 | break; | 498 | break; |