Skip to content

Commit

Permalink
Imporve code format
Browse files Browse the repository at this point in the history
  • Loading branch information
Iam-WenYi committed Aug 25, 2024
1 parent b69ee36 commit accbb1c
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/pikiwidb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -127,15 +127,12 @@ bool PikiwiDB::ParseArgs(int argc, char* argv[]) {
}
case 's': {
unsigned int optarg_long = strlen(optarg);
char *str = calloc(optarg_long, sizeof(char*));
if (str)
{
char* str = calloc(optarg_long, sizeof(char*));
if (str) {
sscanf(optarg, "%s:%d", str, master_port_);
master_ = str;
free(str);
}
else
{
} else {
ERROR("Memory alloc failed.");
}
break;
Expand Down

0 comments on commit accbb1c

Please sign in to comment.