=================================================================== RCS file: /cvsrepo/anoncvs/cvs/src/usr.bin/hexdump/hexsyntax.c,v retrieving revision 1.4 retrieving revision 1.5 diff -c -r1.4 -r1.5 *** src/usr.bin/hexdump/hexsyntax.c 2001/07/12 05:17:10 1.4 --- src/usr.bin/hexdump/hexsyntax.c 2001/11/02 19:41:06 1.5 *************** *** 1,4 **** ! /* $OpenBSD: hexsyntax.c,v 1.4 2001/07/12 05:17:10 deraadt Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. --- 1,4 ---- ! /* $OpenBSD: hexsyntax.c,v 1.5 2001/11/02 19:41:06 mickey Exp $ */ /*- * Copyright (c) 1990 The Regents of the University of California. *************** *** 35,41 **** #ifndef lint /*static char sccsid[] = "from: @(#)hexsyntax.c 5.2 (Berkeley) 5/8/90";*/ ! static char rcsid[] = "$OpenBSD: hexsyntax.c,v 1.4 2001/07/12 05:17:10 deraadt Exp $"; #endif /* not lint */ #include --- 35,41 ---- #ifndef lint /*static char sccsid[] = "from: @(#)hexsyntax.c 5.2 (Berkeley) 5/8/90";*/ ! static char rcsid[] = "$OpenBSD: hexsyntax.c,v 1.5 2001/11/02 19:41:06 mickey Exp $"; #endif /* not lint */ #include *************** *** 43,48 **** --- 43,49 ---- #include #include #include + #include #include "hexdump.h" off_t skip; /* bytes to skip */ *************** *** 81,102 **** addfile(optarg); break; case 'n': ! if ((length = atoi(optarg)) < 0) { ! (void)fprintf(stderr, ! "hexdump: bad length value.\n"); ! exit(1); ! } break; case 'o': add("\"%07.7_Ax\n\""); add("\"%07.7_ax \" 8/2 \" %06o \" \"\\n\""); break; case 's': ! if ((skip = strtol(optarg, &p, 0)) < 0) { ! (void)fprintf(stderr, ! "hexdump: bad skip value.\n"); ! exit(1); ! } switch(*p) { case 'b': skip *= 512; --- 82,97 ---- addfile(optarg); break; case 'n': ! if ((length = atoi(optarg)) < 0) ! errx(1, "bad length value"); break; case 'o': add("\"%07.7_Ax\n\""); add("\"%07.7_ax \" 8/2 \" %06o \" \"\\n\""); break; case 's': ! if ((skip = strtol(optarg, &p, 0)) < 0) ! errx(1, "bad skip value"); switch(*p) { case 'b': skip *= 512; *************** *** 132,138 **** void usage() { ! (void)fprintf(stderr, ! "hexdump: [-bcdovx] [-e fmt] [-f fmt_file] [-n length] [-s skip] [file ...]\n"); exit(1); } --- 127,134 ---- void usage() { ! extern char *__progname; ! fprintf(stderr, "usage: %s [-bcdovx] [-e fmt] [-f fmt_file] " ! "[-n length] [-s skip] [file ...]", __progname); exit(1); }