Skip to content

Commit 2780e32

Browse files
author
Sherman Jun Hong Lim
committed
bugfix feature-cols parsing
1 parent 91f703a commit 2780e32

1 file changed

Lines changed: 2 additions & 3 deletions

File tree

libCacheSim/bin/cli_reader_utils.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -130,13 +130,12 @@ void parse_reader_params(const char *reader_params_str,
130130
} else if (strcasecmp(key, "feature-cols") == 0) {
131131
// feature-cols=1|2|3
132132
char *feature_str = strdup(value);
133-
char *feature = strsep(&feature_str, "|");
133+
char *feature;
134134
int i = 0;
135-
while (feature != NULL) {
135+
while ((feature = strsep(&feature_str, "|")) != NULL) {
136136
params->feature_fields[i] = (int)strtol(feature, &end, 0);
137137
_check_parsed_result(end, params->feature_fields[i]);
138138
i++;
139-
feature = strsep(&feature_str, ",");
140139
}
141140
params->n_feature_fields = i;
142141
} else if (strcasecmp(key, "ttl-col") == 0) {

0 commit comments

Comments
 (0)