diff --git a/src/first-free-port.c b/src/first-free-port.c index c823684..1e246cd 100644 --- a/src/first-free-port.c +++ b/src/first-free-port.c @@ -81,14 +81,14 @@ int main(int argc, char *argv[]) { } if (!is_valid_tcp_port(current_port)) { - fprintf(stderr, "Provide a valid TCP port number as first argument.\n"); + fprintf(stderr, "%s: provide a valid TCP port number as first argument.\n", argv[0]); return EX_USAGE; } // Open TCP table FILE *tcp_table_fptr = fopen(TCP_TABLE, "r"); if (tcp_table_fptr == NULL) { - fprintf(stderr, "Error opening the TCP table.\n"); + fprintf(stderr, "%s: error opening the TCP table.\n", argv[0]); return EX_OSFILE; } @@ -106,7 +106,7 @@ int main(int argc, char *argv[]) { printf("%d\n", current_port); return EXIT_SUCCESS; } else { - fprintf(stderr, "No more ports available. How did you fuck up that bad ???\n"); + fprintf(stderr, "%s: no more ports available; how did you fuck up that bad ???\n", argv[0]); return EX_TEMPFAIL; } }