summaryrefslogtreecommitdiffstats
path: root/usr.bin/printf
diff options
context:
space:
mode:
authordelphij <delphij@FreeBSD.org>2010-12-14 00:21:34 +0000
committerdelphij <delphij@FreeBSD.org>2010-12-14 00:21:34 +0000
commit5715a480cf14c5797c5c5b6c51bf9cef15b1460d (patch)
treeb684d3e090af339c6ed61714e3f26d6c04696ad2 /usr.bin/printf
parenta8a33a7da0a8646d6e328a1036316fc2460583ef (diff)
downloadFreeBSD-src-5715a480cf14c5797c5c5b6c51bf9cef15b1460d.zip
FreeBSD-src-5715a480cf14c5797c5c5b6c51bf9cef15b1460d.tar.gz
Make use of EX_USAGE for usage().
Diffstat (limited to 'usr.bin/printf')
-rw-r--r--usr.bin/printf/printf.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.bin/printf/printf.c b/usr.bin/printf/printf.c
index 53585af..03e0dee 100644
--- a/usr.bin/printf/printf.c
+++ b/usr.bin/printf/printf.c
@@ -53,6 +53,7 @@ static const char rcsid[] =
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
+#include <sysexits.h>
#include <unistd.h>
#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);
}
OpenPOWER on IntegriCloud