Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/error Don't assume isspace(0) == 1



details:   https://anonhg.NetBSD.org/src/rev/a421c32e7f80
branches:  trunk
changeset: 472990:a421c32e7f80
user:      sommerfeld <sommerfeld%NetBSD.org@localhost>
date:      Sat May 15 18:46:27 1999 +0000

description:
Don't assume isspace(0) == 1

diffstat:

 usr.bin/error/subr.c |  8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diffs (36 lines):

diff -r 23e876310619 -r a421c32e7f80 usr.bin/error/subr.c
--- a/usr.bin/error/subr.c      Sat May 15 17:39:07 1999 +0000
+++ b/usr.bin/error/subr.c      Sat May 15 18:46:27 1999 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: subr.c,v 1.6 1998/11/06 23:10:08 christos Exp $        */
+/*     $NetBSD: subr.c,v 1.7 1999/05/15 18:46:27 sommerfeld Exp $      */
 
 /*
  * Copyright (c) 1980, 1993
@@ -38,7 +38,7 @@
 #if 0
 static char sccsid[] = "@(#)subr.c     8.1 (Berkeley) 6/6/93";
 #endif
-__RCSID("$NetBSD: subr.c,v 1.6 1998/11/06 23:10:08 christos Exp $");
+__RCSID("$NetBSD: subr.c,v 1.7 1999/05/15 18:46:27 sommerfeld Exp $");
 #endif /* not lint */
 
 #include <ctype.h>
@@ -347,7 +347,7 @@
                        cp++;
                if (*cp == 0)
                        break;
-               while (!isspace((unsigned char)*cp))
+               while (*cp && !isspace((unsigned char)*cp))
                        cp++;
        }
        wordv = (char **)Calloc(wordcount + 1, sizeof (char *));
@@ -357,7 +357,7 @@
                if (*cp == 0)
                        break;
                wordv[wordindex] = cp;
-               while(!isspace((unsigned char)*cp))
+               while(*cp && !isspace((unsigned char)*cp))
                        cp++;
                *cp++ = '\0';
        }



Home | Main Index | Thread Index | Old Index