Skip to content

Commit

Permalink
Fix code bug
Browse files Browse the repository at this point in the history
  • Loading branch information
Wen Yi committed Aug 25, 2024
1 parent c232619 commit cc5df28
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/pikiwidb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -126,10 +126,10 @@ bool PikiwiDB::ParseArgs(int argc, char* argv[]) {
break;
}
case 's': {
unsigned int optarg_long = strlen(optarg);
char* str = calloc(optarg_long, sizeof(char*));
unsigned int optarg_long = static_cast<unsigned int>(strlen(optarg));
char* str = (char*)calloc(optarg_long, sizeof(char*));
if (str) {
sscanf(optarg, "%s:%d", str, &master_port_);
sscanf(optarg, "%s:%hd", str, &master_port_);
master_ = str;
free(str);
} else {
Expand Down

0 comments on commit cc5df28

Please sign in to comment.