diff options
author | tjr <tjr@FreeBSD.org> | 2002-05-17 07:14:55 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-05-17 07:14:55 +0000 |
commit | 98e1f63634ab9b117258a176e0727c23126bb762 (patch) | |
tree | 49576657a735280445ea47b1b64d5fd64338a7a9 /usr.bin/hexdump/display.c | |
parent | e303f729c675ac851fc3efc31e1df4f0c9bbc71c (diff) | |
download | FreeBSD-src-98e1f63634ab9b117258a176e0727c23126bb762.zip FreeBSD-src-98e1f63634ab9b117258a176e0727c23126bb762.tar.gz |
Overhaul hexdump's od syntax code to handle the -s -A -j -N -t options that
SUSv3 requires and give od a proper manual page.
PR: 36783
Diffstat (limited to 'usr.bin/hexdump/display.c')
-rw-r--r-- | usr.bin/hexdump/display.c | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/usr.bin/hexdump/display.c b/usr.bin/hexdump/display.c index ec957b7..d2e32fc 100644 --- a/usr.bin/hexdump/display.c +++ b/usr.bin/hexdump/display.c @@ -150,9 +150,11 @@ print(pr, bp) bcopy(bp, &f8, sizeof(f8)); (void)printf(pr->fmt, f8); break; - case sizeof(long double): - bcopy(bp, &ldbl, sizeof(ldbl)); - (void)printf(pr->fmt, ldbl); + default: + if (pr->bcnt == sizeof(long double)) { + bcopy(bp, &ldbl, sizeof(ldbl)); + (void)printf(pr->fmt, ldbl); + } break; } break; @@ -259,6 +261,8 @@ get() * block and set the end flag. */ if (!length || (ateof && !next((char **)NULL))) { + if (odmode && address < skip) + errx(1, "cannot skip past end of input"); if (need == blocksize) return((u_char *)NULL); if (vflag != ALL && |