diff options
author | tjr <tjr@FreeBSD.org> | 2002-05-27 03:17:28 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-05-27 03:17:28 +0000 |
commit | ec252a0e8ba9490910124fdad31b4191e33306cd (patch) | |
tree | a93dd73ffe8cef987c3037e0edf1c4568f1a6f5e /usr.bin/hexdump | |
parent | fb067c8f63910d7ce22ee1a1f4a1af679c3cf768 (diff) | |
download | FreeBSD-src-ec252a0e8ba9490910124fdad31b4191e33306cd.zip FreeBSD-src-ec252a0e8ba9490910124fdad31b4191e33306cd.tar.gz |
From NetBSD:
Revision 1.10 Sat Oct 14 17:41:55 2000 UTC by bjh21
Don't core dump with an empty format string. Fixes PR#11218.
Patch supplied by Launey Thomas.
Obtained from: NetBSD
Diffstat (limited to 'usr.bin/hexdump')
-rw-r--r-- | usr.bin/hexdump/parse.c | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/usr.bin/hexdump/parse.c b/usr.bin/hexdump/parse.c index 85e035e..d928a3f 100644 --- a/usr.bin/hexdump/parse.c +++ b/usr.bin/hexdump/parse.c @@ -424,7 +424,7 @@ isint2: switch(fu->bcnt) { * If, rep count is greater than 1, no trailing whitespace * gets output from the last iteration of the format unit. */ - for (fu = fs->nextfu;; fu = fu->nextfu) { + for (fu = fs->nextfu; fu; fu = fu->nextfu) { if (!fu->nextfu && fs->bcnt < blocksize && !(fu->flags&F_SETREP) && fu->bcnt) fu->reps += (blocksize - fs->bcnt) / fu->bcnt; @@ -437,8 +437,6 @@ isint2: switch(fu->bcnt) { if (p2) pr->nospace = p2; } - if (!fu->nextfu) - break; } #ifdef DEBUG for (fu = fs->nextfu; fu; fu = fu->nextfu) { |