mirror of
https://codeberg.org/redict/redict.git
synced 2025-01-22 16:18:28 -05:00
fix: redis-cli --memkeys-samples add check lastarg (#11269)
doing redis-cli --memkeys-samples without any additional arguments would have lead to a crash of the cli.
This commit is contained in:
parent
bd40d3158b
commit
c0725abfbb
@ -2061,7 +2061,7 @@ static int parseOptions(int argc, char **argv) {
|
||||
} else if (!strcmp(argv[i],"--memkeys")) {
|
||||
config.memkeys = 1;
|
||||
config.memkeys_samples = 0; /* use redis default */
|
||||
} else if (!strcmp(argv[i],"--memkeys-samples")) {
|
||||
} else if (!strcmp(argv[i],"--memkeys-samples") && !lastarg) {
|
||||
config.memkeys = 1;
|
||||
config.memkeys_samples = atoi(argv[++i]);
|
||||
} else if (!strcmp(argv[i],"--hotkeys")) {
|
||||
|
Loading…
Reference in New Issue
Block a user