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>
int length;
char *val;
- if (optflag->flags == OPTION_BIN)
- val = trim(strtok(NULL, "")); /* do not split "'q w e'" */
- else
+ if (optflag->flags == OPTION_BIN) {
+ val = strtok(NULL, ""); /* do not split "'q w e'" */
+ trim(val);
+ } else
val = strtok(NULL, ", \t");
if (!val)
break;