diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c index 53585af76dc0..03e0dee5c29a 100644 --- a/usr.bin/printf/printf.c +++ b/usr.bin/printf/printf.c @@ -53,6 +53,7 @@ static const char rcsid[] = #include #include #include +#include #include #ifdef SHELL @@ -115,14 +116,14 @@ main(int argc, char *argv[]) case '?': default: usage(); - return (1); + /* NOTREACHED */ } argc -= optind; argv += optind; if (argc < 1) { usage(); - return (1); + /* NOTREACHED */ } #ifdef SHELL @@ -562,4 +563,5 @@ static void usage(void) { (void)fprintf(stderr, "usage: printf format [arguments ...]\n"); + exit(EX_USAGE); }