diff --git a/src/strcmp.c b/src/strcmp.c index ea20b1e..6d930d5 100644 --- a/src/strcmp.c +++ b/src/strcmp.c @@ -26,18 +26,22 @@ char *program_name = "strcmp"; int main(int argc, char *argv[]) { - program_name = argv[0] == NULL ? program_name : argv[0]; - int i; + unsigned int i; #ifdef __OpenBSD__ if (pledge("stdio", NULL) == -1) { - perror(program_name); + perror(argv[0] == NULL ? program_name : argv[0]); + return EX_OSERR; } #endif if (argc < 3) { - (void)fprintf(stderr, "Usage: %s string string...\n", program_name); + (void)fprintf( + stderr, + "Usage: %s string string...\n", + argv[0] == NULL ? program_name : argv[0] + ); return EX_USAGE; }