Skip to content

Commit

Permalink
Fix issue RedisLabs#211. Allow key_stddev and key_median options to b…
Browse files Browse the repository at this point in the history
…e set values

exceeding unsigned int.
  • Loading branch information
clkbug committed Apr 14, 2023
1 parent 1620979 commit 2bf9737
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions memtier_benchmark.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -694,15 +694,15 @@ static int config_parse_args(int argc, char *argv[], struct benchmark_config *cf
break;
case o_key_stddev:
endptr = NULL;
cfg->key_stddev = (unsigned int) strtof(optarg, &endptr);
cfg->key_stddev = strtoull(optarg, &endptr, 10);
if (cfg->key_stddev<= 0 || !endptr || *endptr != '\0') {
fprintf(stderr, "error: key-stddev must be greater than zero.\n");
return -1;
}
break;
case o_key_median:
endptr = NULL;
cfg->key_median = (unsigned int) strtof(optarg, &endptr);
cfg->key_median = strtoull(optarg, &endptr, 10);
if (cfg->key_median<= 0 || !endptr || *endptr != '\0') {
fprintf(stderr, "error: key-median must be greater than zero.\n");
return -1;
Expand Down

0 comments on commit 2bf9737

Please sign in to comment.