diff options
author | Peter Valchev <pvalchev@cvs.openbsd.org> | 2001-12-30 08:17:33 +0000 |
---|---|---|
committer | Peter Valchev <pvalchev@cvs.openbsd.org> | 2001-12-30 08:17:33 +0000 |
commit | d5d19f2d773d90fe05e2a93c2878ece3b2a4a7fc (patch) | |
tree | eabe05d107d7761a7d3ce8ea9f04236ef4a93b64 /usr.bin/hexdump/hexdump.c | |
parent | 80376a6f4b8ec8fa3670cc0fade14a38c69d5a10 (diff) |
Changes come from NetBSD, Lite-2 and me. ok deraadt
od(1):
- Enable support for printing 8-byte integers.
- Added -C option for hexadecimal+ASCII display.
- Fix od so it displays short files containing nulls.
- POSIXification: The C, S, I and L modifiers now behave correctly,
specifying output in units of a char, short, int and long (as defined by
the host system) respectively. Support -N, equivalent to hexdump's
-n (format only COUNT bytes of input). Add -j option which does the
same thing as -s in hexdump (skipping some of the input).
hexdump(1):
- POSIX.2 doesn't specify hexdump so it can't be compatible with it...
- add missing trailing \n in usage() printf
Diffstat (limited to 'usr.bin/hexdump/hexdump.c')
-rw-r--r-- | usr.bin/hexdump/hexdump.c | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/usr.bin/hexdump/hexdump.c b/usr.bin/hexdump/hexdump.c index c1dda5e0762..52b99388364 100644 --- a/usr.bin/hexdump/hexdump.c +++ b/usr.bin/hexdump/hexdump.c @@ -1,8 +1,9 @@ -/* $OpenBSD: hexdump.c,v 1.6 2001/11/19 19:02:14 mpech Exp $ */ +/* $OpenBSD: hexdump.c,v 1.7 2001/12/30 08:17:32 pvalchev Exp $ */ +/* $NetBSD: hexdump.c,v 1.7 1997/10/19 02:34:06 lukem Exp $ */ /* - * Copyright (c) 1989 The Regents of the University of California. - * All rights reserved. + * Copyright (c) 1989, 1993 + * The Regents of the University of California. All rights reserved. * * Redistribution and use in source and binary forms, with or without * modification, are permitted provided that the following conditions @@ -41,7 +42,7 @@ char copyright[] = #ifndef lint /*static char sccsid[] = "from: @(#)hexdump.c 5.5 (Berkeley) 6/1/90";*/ -static char rcsid[] = "$OpenBSD: hexdump.c,v 1.6 2001/11/19 19:02:14 mpech Exp $"; +static char rcsid[] = "$OpenBSD: hexdump.c,v 1.7 2001/12/30 08:17:32 pvalchev Exp $"; #endif /* not lint */ #include <sys/types.h> @@ -54,10 +55,12 @@ int blocksize; /* data block size */ int exitval; /* final exit value */ int length = -1; /* max bytes to read */ +int main __P((int, char **)); + int main(argc, argv) int argc; - char **argv; + char *argv[]; { FS *tfs; char *p; |