summaryrefslogtreecommitdiffstats
path: root/booster
diff options
context:
space:
mode:
Diffstat (limited to 'booster')
-rw-r--r--booster/src/booster.c20
1 files changed, 14 insertions, 6 deletions
diff --git a/booster/src/booster.c b/booster/src/booster.c
index de5bd3253..b9d870d8c 100644
--- a/booster/src/booster.c
+++ b/booster/src/booster.c
@@ -263,18 +263,26 @@ get_option_value (char *opt)
char *val = NULL;
char *saveptr = NULL;
char *copy_opt = NULL;
- char *nextopt = NULL;
char *retval = NULL;
copy_opt = strdup (opt);
- val = strtok_r (copy_opt, "=", &saveptr);
- if (val != NULL) {
- nextopt = index (val, ',');
- if (nextopt)
- *nextopt = '\0';
+ /* Get the = before the value of the option. */
+ val = index (copy_opt, '=');
+ if (val) {
+ /* Move to start of option */
+ ++val;
+
+ /* Now, to create a '\0' delimited string out of the
+ * options string, first get the position where the
+ * next option starts, that would be the next ','.
+ */
+ saveptr = index (val, ',');
+ if (saveptr)
+ *saveptr = '\0';
retval = strdup (val);
}
+
free (copy_opt);
return retval;