Skip to content

Commit

Permalink
fix: TOOLS-2324 allow space after -P (#89)
Browse files Browse the repository at this point in the history
  • Loading branch information
dwelch-spike authored Apr 17, 2023
1 parent e9cfa76 commit 89ddafe
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions src/main/benchmark_init.c
Original file line number Diff line number Diff line change
Expand Up @@ -1212,9 +1212,17 @@ set_args(int argc, char * const* argv, args_t* args)
break;

case 'P':
as_password_acquire(args->password, optarg, AS_PASSWORD_SIZE);
if (optarg == NULL &&
optind < argc &&
argv[optind] != NULL &&
argv[optind][0] != '\0' &&
argv[optind][0] != '-' ) {
// space separated argument value
as_strncpy(args->password, argv[optind], AS_PASSWORD_SIZE);
} else {
as_password_acquire(args->password, optarg, AS_PASSWORD_SIZE);
}
break;

case BENCH_OPT_CONNECT_TIMEOUT:
args->conn_timeout_ms = atoi(optarg);
break;
Expand Down

0 comments on commit 89ddafe

Please sign in to comment.