diff options
author | charnier <charnier@FreeBSD.org> | 1997-07-10 06:48:24 +0000 |
---|---|---|
committer | charnier <charnier@FreeBSD.org> | 1997-07-10 06:48:24 +0000 |
commit | c4ced555e147c0328b1ac46abe1b7b5f63b1c251 (patch) | |
tree | 393f17c41d577ae35a6b7bbd2f07fc43da455975 /usr.bin/hexdump/hexsyntax.c | |
parent | 6ebe32537f9689d704daaa1207b4518a57085b2f (diff) | |
download | FreeBSD-src-c4ced555e147c0328b1ac46abe1b7b5f63b1c251.zip FreeBSD-src-c4ced555e147c0328b1ac46abe1b7b5f63b1c251.tar.gz |
Use err(3) instead of local redefinition, incorporate `hd' in usage str.
Diffstat (limited to 'usr.bin/hexdump/hexsyntax.c')
-rw-r--r-- | usr.bin/hexdump/hexsyntax.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/usr.bin/hexdump/hexsyntax.c b/usr.bin/hexdump/hexsyntax.c index 279a68c..ae21411 100644 --- a/usr.bin/hexdump/hexsyntax.c +++ b/usr.bin/hexdump/hexsyntax.c @@ -32,11 +32,16 @@ */ #ifndef lint +#if 0 static char sccsid[] = "@(#)hexsyntax.c 8.2 (Berkeley) 5/4/95"; +#endif +static const char rcsid[] = + "$Id$"; #endif /* not lint */ #include <sys/types.h> +#include <err.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -92,7 +97,7 @@ newsyntax(argc, argvp) break; case 'n': if ((length = atoi(optarg)) < 0) - err("%s: bad length value", optarg); + errx(1, "%s: bad length value", optarg); break; case 'o': add("\"%07.7_Ax\n\""); @@ -100,7 +105,7 @@ newsyntax(argc, argvp) break; case 's': if ((skip = strtol(optarg, &p, 0)) < 0) - err("%s: bad skip value", optarg); + errx(1, "%s: bad skip value", optarg); switch(*p) { case 'b': skip *= 512; @@ -135,7 +140,10 @@ newsyntax(argc, argvp) void usage() { - (void)fprintf(stderr, -"hexdump: [-bcCdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]\n"); + (void)fprintf(stderr, "%s\n%s\n%s\n%s\n", +"usage: hexdump [-bcCdovx] [-e fmt] [-f fmt_file] [-n length]", +" [-s skip] [file ...]", +" hd [-bcdovx] [-e fmt] [-f fmt_file] [-n length]", +" [-s skip] [file ...]"); exit(1); } |