Skip to content

Commit

Permalink
make error messages more concise
Browse files Browse the repository at this point in the history
  • Loading branch information
SafeCoding233 committed Jul 28, 2024
1 parent 835e276 commit d1c025b
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions graftcp.c
Original file line number Diff line number Diff line change
Expand Up @@ -582,7 +582,7 @@ int client_main(int argc, char **argv)
case 'a':
cmd_conf.local_addr = strdup(optarg);
if (cmd_conf.local_addr == NULL) {
perror("strdup failed to allocate memory");
perror("strdup");
exit(1);
}
break;
Expand All @@ -593,21 +593,21 @@ int client_main(int argc, char **argv)
case 'f':
cmd_conf.pipe_path = strdup(optarg);
if (cmd_conf.pipe_path == NULL) {
perror("strdup failed to allocate memory");
perror("strdup");
exit(1);
}
break;
case 'b':
cmd_conf.blackip_file_path = strdup(optarg);
if (cmd_conf.blackip_file_path == NULL) {
perror("strdup failed to allocate memory");
perror("strdup");
exit(1);
}
break;
case 'w':
cmd_conf.whiteip_file_path = strdup(optarg);
if (cmd_conf.whiteip_file_path == NULL) {
perror("strdup failed to allocate memory");
perror("strdup");
exit(1);
}
break;
Expand All @@ -618,14 +618,14 @@ int client_main(int argc, char **argv)
case 'c':
conf_file_path = strdup(optarg);
if (conf_file_path == NULL) {
perror("strdup failed to allocate memory");
perror("strdup");
exit(1);
}
break;
case 'u':
cmd_conf.username = strdup(optarg);
if (cmd_conf.username == NULL) {
perror("strdup failed to allocate memory");
perror("strdup");
exit(1);
}
break;
Expand Down Expand Up @@ -695,7 +695,7 @@ int client_main(int argc, char **argv)
run_uid = pent->pw_uid;
run_home = strdup(pent->pw_dir);
if (run_home == NULL) {
perror("strdup failed to allocate memory");
perror("strdup");
exit(1);
}
}
Expand Down

0 comments on commit d1c025b

Please sign in to comment.