diff --git a/sysbench/sb_options.c b/sysbench/sb_options.c index bc541fc..423f5d6 100644 --- a/sysbench/sb_options.c +++ b/sysbench/sb_options.c @@ -103,6 +103,7 @@ static void read_config_file(const char *filename) int set_option(const char *name, const char *value, sb_arg_type_t type) { option_t *opt; + char *tmpbuf; char *tmp; opt = add_option(&options, name); @@ -128,10 +129,14 @@ int set_option(const char *name, const char *value, sb_arg_type_t type) if (value == NULL) break; - tmp = strdup(value); + tmpbuf = strdup(value); + tmp = tmpbuf; + for (tmp = strtok(tmp, ","); tmp != NULL; tmp = strtok(NULL, ",")) add_value(&opt->values, tmp); - free(tmp); + + free(tmpbuf); + break; case SB_ARG_TYPE_FILE: read_config_file(value);