Skip to content

Commit 2bf9737

Browse files
committed
Fix issue RedisLabs#211. Allow key_stddev and key_median options to be set values
exceeding unsigned int.
1 parent 1620979 commit 2bf9737

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

memtier_benchmark.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -694,15 +694,15 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf
694694
break;
695695
case o_key_stddev:
696696
endptr = NULL;
697-
cfg->key_stddev = (unsigned int) strtof(optarg, &endptr);
697+
cfg->key_stddev = strtoull(optarg, &endptr, 10);
698698
if (cfg->key_stddev<= 0 || !endptr || *endptr != '\0') {
699699
fprintf(stderr, "error: key-stddev must be greater than zero.\n");
700700
return -1;
701701
}
702702
break;
703703
case o_key_median:
704704
endptr = NULL;
705-
cfg->key_median = (unsigned int) strtof(optarg, &endptr);
705+
cfg->key_median = strtoull(optarg, &endptr, 10);
706706
if (cfg->key_median<= 0 || !endptr || *endptr != '\0') {
707707
fprintf(stderr, "error: key-median must be greater than zero.\n");
708708
return -1;

0 commit comments

Comments
 (0)