Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-5]: src/usr.bin/hexdump Pullup 1.10 [bjh21]:



details:   https://anonhg.NetBSD.org/src/rev/8927170ca02a
branches:  netbsd-1-5
changeset: 489770:8927170ca02a
user:      tv <tv%NetBSD.org@localhost>
date:      Tue Oct 17 01:32:31 2000 +0000

description:
Pullup 1.10 [bjh21]:
Don't core dump with an empty format string.  Fixes PR#11218.
Patch supplied by Launey Thomas.

diffstat:

 usr.bin/hexdump/parse.c |  8 +++-----
 1 files changed, 3 insertions(+), 5 deletions(-)

diffs (36 lines):

diff -r f4fe59a1a67c -r 8927170ca02a usr.bin/hexdump/parse.c
--- a/usr.bin/hexdump/parse.c   Tue Oct 17 01:29:47 2000 +0000
+++ b/usr.bin/hexdump/parse.c   Tue Oct 17 01:32:31 2000 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.8 1998/12/19 16:43:39 christos Exp $       */
+/*     $NetBSD: parse.c,v 1.8.10.1 2000/10/17 01:32:31 tv Exp $        */
 
 /*
  * Copyright (c) 1989, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)parse.c    8.1 (Berkeley) 6/6/93";
 #else
-__RCSID("$NetBSD: parse.c,v 1.8 1998/12/19 16:43:39 christos Exp $");
+__RCSID("$NetBSD: parse.c,v 1.8.10.1 2000/10/17 01:32:31 tv Exp $");
 #endif
 #endif /* not lint */
 
@@ -425,7 +425,7 @@
         * 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;
@@ -438,8 +438,6 @@
                        if (p2)
                                pr->nospace = p2;
                }
-               if (!fu->nextfu)
-                       break;
        }
 #ifdef DEBUG
        for (fu = fs->nextfu; fu; fu = fu->nextfu) {



Home | Main Index | Thread Index | Old Index