Unix Technical Forum

SEO

vBulletin Search Engine Optimization


Go Back   Unix Technical Forum > Unix Operating Systems > OpenBSD > mailing.openbsd.tech

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 02-18-2008, 08:58 AM
Charles Longeau
 
Posts: n/a
Default isspace, isdigit, isalnum, isblank, isgraph, islower, isprint usage

Hi,

All isspace(3), isdigit(3), isalnum(3), isblank(3), isgraph(3),
islower(3), isprint(3) functions return false for c == 0.

That's why :

*p && isspace(*p)

is equivalent to :

isspace(*p)

Best regards,

Charles Longeau

Index: games/arithmetic/arithmetic.c
================================================== =================
RCS file: /cvs/src/games/arithmetic/arithmetic.c,v
retrieving revision 1.15
diff -u -p -r1.15 arithmetic.c
--- games/arithmetic/arithmetic.c 9 Jul 2004 15:59:26 -0000 1.15
+++ games/arithmetic/arithmetic.c 10 Nov 2006 12:13:48 -0000
@@ -236,7 +236,7 @@ retry:
(void)printf("\n");
return(EOF);
}
- for (p = line; *p && isspace(*p); ++p);
+ for (p = line; isspace(*p); ++p);
if (!isdigit(*p)) {
(void)printf("Please type a number.\n");
continue;
Index: games/hunt/huntd/conf.c
================================================== =================
RCS file: /cvs/src/games/hunt/huntd/conf.c,v
retrieving revision 1.6
diff -u -p -r1.6 conf.c
--- games/hunt/huntd/conf.c 16 Jan 2004 00:13:19 -0000 1.6
+++ games/hunt/huntd/conf.c 11 Nov 2006 13:54:47 -0000
@@ -137,7 +137,7 @@ parse_int(p, kvp, fnm, linep)
if (*p == '-')
p++;
digitstart = p;
- while (*p && isdigit(*p))
+ while (isdigit(*p))
p++;
if ((*p == '\0' || isspace(*p) || *p == '#') && digitstart != p) {
savec = *p;
@@ -190,7 +190,7 @@ parse_line(buf, fnm, line)
p = buf;

/* skip leading white */
- while (*p && isspace(*p))
+ while (isspace(*p))
p++;
/* allow blank lines and comment lines */
if (*p == '\0' || *p == '#')
@@ -198,9 +198,9 @@ parse_line(buf, fnm, line)

/* walk to the end of the word: */
word = p;
- if (*p && (isalpha(*p) || *p == '_')) {
+ if (isalpha(*p) || *p == '_') {
p++;
- while (*p && (isalpha(*p) || isdigit(*p) || *p == '_'))
+ while (isalpha(*p) || isdigit(*p) || *p == '_')
p++;
}
endword = p;
@@ -227,7 +227,7 @@ parse_line(buf, fnm, line)
}

/* skip whitespace */
- while (*p && isspace(*p))
+ while (isspace(*p))
p++;

if (*p++ != '=') {
@@ -236,7 +236,7 @@ parse_line(buf, fnm, line)
}

/* skip whitespace */
- while (*p && isspace(*p))
+ while (isspace(*p))
p++;

/* parse the value */
@@ -245,7 +245,7 @@ parse_line(buf, fnm, line)
return;

/* skip trailing whitespace */
- while (*p && isspace(*p))
+ while (isspace(*p))
p++;

if (*p && *p != '#') {
Index: kerberosV/src/appl/test/http_client.c
================================================== =================
RCS file: /cvs/src/kerberosV/src/appl/test/http_client.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 http_client.c
--- kerberosV/src/appl/test/http_client.c 14 Apr 2006 07:32:01 -0000 1.1.1.1
+++ kerberosV/src/appl/test/http_client.c 10 Nov 2006 13:30:35 -0000
@@ -375,7 +375,7 @@ main(int argc, char **argv)
}

i = 9;
- while(h[i] && isspace((unsigned char)h[i]))
+ while(isspace((unsigned char)h[i]))
i++;
if (h[i] != '\0') {
int len = strlen(&h[i]);
Index: lib/libc/net/res_debug.c
================================================== =================
RCS file: /cvs/src/lib/libc/net/res_debug.c,v
retrieving revision 1.21
diff -u -p -r1.21 res_debug.c
--- lib/libc/net/res_debug.c 6 Aug 2005 20:30:04 -0000 1.21
+++ lib/libc/net/res_debug.c 10 Nov 2006 13:39:09 -0000
@@ -1194,7 +1194,7 @@ loc_aton(const char *ascii, u_char *bina
while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;

- while (isspace(*cp) && (cp < maxcp))
+ while (isspace(*cp))
cp++;

if (cp >= maxcp)
@@ -1205,7 +1205,7 @@ loc_aton(const char *ascii, u_char *bina
while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;

- while (isspace(*cp) && (cp < maxcp))
+ while (isspace(*cp))
cp++;

if (cp >= maxcp)
@@ -1216,7 +1216,7 @@ loc_aton(const char *ascii, u_char *bina
while (!isspace(*cp) && (cp < maxcp)) /* if trailing garbage or m */
cp++;

- while (isspace(*cp) && (cp < maxcp))
+ while (isspace(*cp))
cp++;

if (cp >= maxcp)
Index: lib/libcurses/tinfo/comp_hash.c
================================================== =================
RCS file: /cvs/src/lib/libcurses/tinfo/comp_hash.c,v
retrieving revision 1.6
diff -u -p -r1.6 comp_hash.c
--- lib/libcurses/tinfo/comp_hash.c 18 Mar 2003 16:55:54 -0000 1.6
+++ lib/libcurses/tinfo/comp_hash.c 10 Nov 2006 13:59:12 -0000
@@ -216,7 +216,7 @@ static char **parse_columns(char *buffer
col++;
if (mark == '\0')
break;
- while (*++s && isspace(*s))
+ while (isspace(*++s))
/*EMPTY*/;
buffer = s;
} else
Index: lib/libform/fty_alnum.c
================================================== =================
RCS file: /cvs/src/lib/libform/fty_alnum.c,v
retrieving revision 1.6
diff -u -p -r1.6 fty_alnum.c
--- lib/libform/fty_alnum.c 22 Jan 2001 18:02:16 -0000 1.6
+++ lib/libform/fty_alnum.c 11 Nov 2006 13:00:55 -0000
@@ -95,7 +95,7 @@ static bool Check_AlphaNumeric_Field(FIE
if (*bp)
{
s = bp;
- while(*bp && isalnum(*bp))
+ while(isalnum(*bp))
bp++;
l = (int)(bp-s);
while(*bp && *bp==' ')
Index: lib/libform/fty_alpha.c
================================================== =================
RCS file: /cvs/src/lib/libform/fty_alpha.c,v
retrieving revision 1.6
diff -u -p -r1.6 fty_alpha.c
--- lib/libform/fty_alpha.c 22 Jan 2001 18:02:17 -0000 1.6
+++ lib/libform/fty_alpha.c 11 Nov 2006 13:13:22 -0000
@@ -96,7 +96,7 @@ static bool Check_Alpha_Field(FIELD * fi
if (*bp)
{
s = bp;
- while(*bp && isalpha(*bp))
+ while(isalpha(*bp))
bp++;
l = (int)(bp-s);
while(*bp && *bp==' ')
Index: lib/libform/fty_ipv4.c
================================================== =================
RCS file: /cvs/src/lib/libform/fty_ipv4.c,v
retrieving revision 1.4
diff -u -p -r1.4 fty_ipv4.c
--- lib/libform/fty_ipv4.c 22 Jan 2001 18:02:17 -0000 1.4
+++ lib/libform/fty_ipv4.c 10 Nov 2006 14:00:12 -0000
@@ -40,7 +40,7 @@ static bool Check_IPV4_Field(FIELD * fie
if (num == 4)
{
bp += len; /* Make bp point to what sscanf() left */
- while (*bp && isspace((unsigned char)*bp))
+ while (isspace((unsigned char)*bp))
bp++; /* Allow trailing whitespace */
}
}
Index: lib/libskey/skeylogin.c
================================================== =================
RCS file: /cvs/src/lib/libskey/skeylogin.c,v
retrieving revision 1.53
diff -u -p -r1.53 skeylogin.c
--- lib/libskey/skeylogin.c 10 Apr 2006 08:06:08 -0000 1.53
+++ lib/libskey/skeylogin.c 11 Nov 2006 13:01:33 -0000
@@ -430,7 +430,7 @@ skey_fakeprompt(char *username, char *sk
if (gethostname(pbuf, sizeof(pbuf)) == -1)
*(p = pbuf) = '.';
else
- for (p = pbuf; *p && isalnum(*p); p++)
+ for (p = pbuf; isalnum(*p); p++)
if (isalpha(*p) && isupper(*p))
*p = (char)tolower(*p);
if (*p && pbuf - p < 4)
Index: lib/libssl/src/crypto/conf/conf_mod.c
================================================== =================
RCS file: /cvs/src/lib/libssl/src/crypto/conf/conf_mod.c,v
retrieving revision 1.5
diff -u -p -r1.5 conf_mod.c
--- lib/libssl/src/crypto/conf/conf_mod.c 8 Apr 2004 08:03:13 -0000 1.5
+++ lib/libssl/src/crypto/conf/conf_mod.c 10 Nov 2006 14:00:48 -0000
@@ -587,7 +587,7 @@ int CONF_parse_list(const char *list_, i
{
if (nospc)
{
- while(*lstart && isspace((unsigned char)*lstart))
+ while(isspace((unsigned char)*lstart))
lstart++;
}
p = strchr(lstart, sep);
Index: lib/libssl/src/crypto/ocsp/ocsp_ht.c
================================================== =================
RCS file: /cvs/src/lib/libssl/src/crypto/ocsp/ocsp_ht.c,v
retrieving revision 1.2
diff -u -p -r1.2 ocsp_ht.c
--- lib/libssl/src/crypto/ocsp/ocsp_ht.c 12 May 2003 02:18:38 -0000 1.2
+++ lib/libssl/src/crypto/ocsp/ocsp_ht.c 10 Nov 2006 14:01:49 -0000
@@ -120,7 +120,7 @@ Content-Length: %d\r\n\r\n";
goto err;
}
/* Skip past white space to start of response code */
- while(*p && isspace((unsigned char)*p)) p++;
+ while(isspace((unsigned char)*p)) p++;
if(!*p) {
OCSPerr(OCSP_F_OCSP_SENDREQ_BIO,OCSP_R_SERVER_RESP ONSE_PARSE_ERROR);
goto err;
@@ -137,7 +137,7 @@ Content-Length: %d\r\n\r\n";
retcode = strtoul(p, &r, 10);
if(*r) goto err;
/* Skip over any leading white space in message */
- while(*q && isspace((unsigned char)*q)) q++;
+ while(isspace((unsigned char)*q)) q++;
if(*q) {
/* Finally zap any trailing white space in message (include CRLF) */
/* We know q has a non white space character so this is OK */
@@ -156,7 +156,7 @@ Content-Length: %d\r\n\r\n";
/* Find blank line marking beginning of content */
while(BIO_gets(mem, tmpbuf, 512) > 0)
{
- for(p = tmpbuf; *p && isspace((unsigned char)*p); p++) continue;
+ for(p = tmpbuf; isspace((unsigned char)*p); p++) continue;
if(!*p) break;
}
if(*p) {
Index: lib/libssl/src/crypto/x509v3/v3_utl.c
================================================== =================
RCS file: /cvs/src/lib/libssl/src/crypto/x509v3/v3_utl.c,v
retrieving revision 1.6
diff -u -p -r1.6 v3_utl.c
--- lib/libssl/src/crypto/x509v3/v3_utl.c 6 Aug 2003 21:08:06 -0000 1.6
+++ lib/libssl/src/crypto/x509v3/v3_utl.c 10 Nov 2006 14:03:58 -0000
@@ -337,7 +337,7 @@ static char *strip_spaces(char *name)
char *p, *q;
/* Skip over leading spaces */
p = name;
- while(*p && isspace((unsigned char)*p)) p++;
+ while(isspace((unsigned char)*p)) p++;
if(!*p) return NULL;
q = p + strlen(p) - 1;
while((q != p) && isspace((unsigned char)*q)) q--;
Index: lib/libusbhid/usage.c
================================================== =================
RCS file: /cvs/src/lib/libusbhid/usage.c,v
retrieving revision 1.11
diff -u -p -r1.11 usage.c
--- lib/libusbhid/usage.c 27 Oct 2006 15:26:25 -0000 1.11
+++ lib/libusbhid/usage.c 10 Nov 2006 14:04:47 -0000
@@ -93,7 +93,7 @@ hid_start(const char *hidname)
break;
if (line[0] == '#')
continue;
- for (p = line; *p && isspace(*p); p++)
+ for (p = line; isspace(*p); p++)
;
if (!*p)
continue;
Index: lib/libutil/fmt_scaled.c
================================================== =================
RCS file: /cvs/src/lib/libutil/fmt_scaled.c,v
retrieving revision 1.8
diff -u -p -r1.8 fmt_scaled.c
--- lib/libutil/fmt_scaled.c 19 Oct 2005 18:48:11 -0000 1.8
+++ lib/libutil/fmt_scaled.c 11 Nov 2006 14:04:34 -0000
@@ -77,7 +77,7 @@ scan_scaled(char *scaled, long long *res
long long scale_fact = 1, whole = 0, fpart = 0;

/* Skip leading whitespace */
- while (*p && isascii(*p) && isspace(*p))
+ while (isascii(*p) && isspace(*p))
++p;

/* Then at most one leading + or - */
@@ -104,7 +104,7 @@ scan_scaled(char *scaled, long long *res
* (but note that E for Exa might look like e to some!).
* Advance 'p' to end, to get scale factor.
*/
- for (; *p && isascii(*p) && (isdigit(*p) || *p=='.'); ++p) {
+ for (; isascii(*p) && (isdigit(*p) || *p=='.'); ++p) {
if (*p == '.') {
if (fract_digits > 0) { /* oops, more than one '.' */
errno = EINVAL;
@@ -151,7 +151,7 @@ scan_scaled(char *scaled, long long *res
*p == tolower(scale_chars[i])) {

/* If it ends with alphanumerics after the scale char, bad. */
- if (*(p+1) != '\0' && isalnum(*(p+1))) {
+ if (isalnum(*(p+1))) {
errno = EINVAL;
return -1;
}
Index: libexec/identd/parse.c
================================================== =================
RCS file: /cvs/src/libexec/identd/parse.c,v
retrieving revision 1.43
diff -u -p -r1.43 parse.c
--- libexec/identd/parse.c 6 Dec 2005 22:05:22 -0000 1.43
+++ libexec/identd/parse.c 10 Nov 2006 14:06:15 -0000
@@ -215,7 +215,7 @@ parse(int fd, struct in_addr *laddr, str

/* Pull out local and remote ports */
p = buf;
- while (*p != '\0' && isspace(*p))
+ while (isspace(*p))
p++;
if ((p = strtok(p, " \t,"))) {
lport = atoi(p);
@@ -413,7 +413,7 @@ parse6(int fd, struct sockaddr_in6 *ladd

/* Pull out local and remote ports */
p = buf;
- while (*p != '\0' && isspace(*p))
+ while (isspace(*p))
p++;
if ((p = strtok(p, " \t,"))) {
lport = atoi(p);
Index: libexec/login_radius/login_radius.c
================================================== =================
RCS file: /cvs/src/libexec/login_radius/login_radius.c,v
retrieving revision 1.5
diff -u -p -r1.5 login_radius.c
--- libexec/login_radius/login_radius.c 29 Jul 2003 18:39:23 -0000 1.5
+++ libexec/login_radius/login_radius.c 12 Nov 2006 13:24:46 -0000
@@ -204,7 +204,7 @@ static int
cleanstring(char *s)
{

- while (*s && isgraph(*s) && *s != '\\')
+ while (isgraph(*s) && *s != '\\')
++s;
return(*s == '\0' ? 1 : 0);
}
Index: sbin/mount_ados/mount_ados.c
================================================== =================
RCS file: /cvs/src/sbin/mount_ados/mount_ados.c,v
retrieving revision 1.13
diff -u -p -r1.13 mount_ados.c
--- sbin/mount_ados/mount_ados.c 8 Apr 2005 20:09:36 -0000 1.13
+++ sbin/mount_ados/mount_ados.c 11 Nov 2006 14:07:37 -0000
@@ -140,7 +140,7 @@ a_gid(char *s)
if ((gr = getgrnam(s)) != NULL)
gid = gr->gr_gid;
else {
- for (gname = s; *s && isdigit(*s); ++s);
+ for (gname = s; isdigit(*s); ++s);
if (!*s)
gid = atoi(gname);
else
@@ -159,7 +159,7 @@ a_uid(char *s)
if ((pw = getpwnam(s)) != NULL)
uid = pw->pw_uid;
else {
- for (uname = s; *s && isdigit(*s); ++s);
+ for (uname = s; isdigit(*s); ++s);
if (!*s)
uid = atoi(uname);
else
Index: sbin/mount_msdos/mount_msdos.c
================================================== =================
RCS file: /cvs/src/sbin/mount_msdos/mount_msdos.c,v
retrieving revision 1.19
diff -u -p -r1.19 mount_msdos.c
--- sbin/mount_msdos/mount_msdos.c 8 Apr 2005 20:09:37 -0000 1.19
+++ sbin/mount_msdos/mount_msdos.c 11 Nov 2006 14:08:00 -0000
@@ -170,7 +170,7 @@ a_gid(char *s)
if ((gr = getgrnam(s)) != NULL)
gid = gr->gr_gid;
else {
- for (gname = s; *s && isdigit(*s); ++s);
+ for (gname = s; isdigit(*s); ++s);
if (!*s)
gid = atoi(gname);
else
@@ -189,7 +189,7 @@ a_uid(char *s)
if ((pw = getpwnam(s)) != NULL)
uid = pw->pw_uid;
else {
- for (uname = s; *s && isdigit(*s); ++s);
+ for (uname = s; isdigit(*s); ++s);
if (!*s)
uid = atoi(uname);
else
Index: sys/arch/zaurus/stand/zboot/cmd.c
================================================== =================
RCS file: /cvs/src/sys/arch/zaurus/stand/zboot/cmd.c,v
retrieving revision 1.2
diff -u -p -r1.2 cmd.c
--- sys/arch/zaurus/stand/zboot/cmd.c 11 May 2005 16:42:15 -0000 1.2
+++ sys/arch/zaurus/stand/zboot/cmd.c 11 Nov 2006 14:09:09 -0000
@@ -397,7 +397,7 @@ Xstty(void)
cnspeed(dev, -1));
else {
sp = 0;
- for (cp = cmd.argv[2]; *cp && isdigit(*cp); cp++)
+ for (cp = cmd.argv[2]; isdigit(*cp); cp++)
sp = sp * 10 + (*cp - '0');
cnspeed(dev, sp);
}
Index: usr.bin/chpass/edit.c
================================================== =================
RCS file: /cvs/src/usr.bin/chpass/edit.c,v
retrieving revision 1.29
diff -u -p -r1.29 edit.c
--- usr.bin/chpass/edit.c 30 Mar 2006 21:08:21 -0000 1.29
+++ usr.bin/chpass/edit.c 12 Nov 2006 13:51:19 -0000
@@ -182,7 +182,7 @@ verify(char *tempname, struct passwd *pw
goto bad;
}
while (isspace(*++p));
- for (q = p; *q && isprint(*q); q++) {
+ for (q = p; isprint(*q); q++) {
if (ep->except && strchr(ep->except,*q))
break;
}
Index: usr.bin/column/column.c
================================================== =================
RCS file: /cvs/src/usr.bin/column/column.c,v
retrieving revision 1.11
diff -u -p -r1.11 column.c
--- usr.bin/column/column.c 10 Mar 2006 19:14:58 -0000 1.11
+++ usr.bin/column/column.c 10 Nov 2006 14:08:06 -0000
@@ -264,7 +264,7 @@ input(FILE *fp)
if (!list)
list = emalloc((maxentry = DEFNUM) * sizeof(char *));
while (fgets(buf, MAXLINELEN, fp)) {
- for (p = buf; *p && isspace(*p); ++p);
+ for (p = buf; isspace(*p); ++p);
if (!*p)
continue;
if (!(p = strchr(p, '\n'))) {
Index: usr.bin/encrypt/encrypt.c
================================================== =================
RCS file: /cvs/src/usr.bin/encrypt/encrypt.c,v
retrieving revision 1.24
diff -u -p -r1.24 encrypt.c
--- usr.bin/encrypt/encrypt.c 2 Nov 2006 18:02:16 -0000 1.24
+++ usr.bin/encrypt/encrypt.c 10 Nov 2006 14:12:16 -0000
@@ -77,7 +77,7 @@ trim(char *line)
}
ptr[1] = '\0';

- for (ptr = line; *ptr && isspace(*ptr); ptr++)
+ for (ptr = line; isspace(*ptr); ptr++)
;

return(ptr);
Index: usr.bin/fmt/fmt.c
================================================== =================
RCS file: /cvs/src/usr.bin/fmt/fmt.c,v
retrieving revision 1.23
diff -u -p -r1.23 fmt.c
--- usr.bin/fmt/fmt.c 8 Mar 2005 23:34:43 -0000 1.23
+++ usr.bin/fmt/fmt.c 11 Nov 2006 13:03:51 -0000
@@ -497,7 +497,7 @@ might_be_header(const unsigned char *lin

if (!isupper(*line++))
return 0;
- while (*line && (isalnum(*line) || *line == '-'))
+ while (isalnum(*line) || *line == '-')
++line;
return (*line == ':' && isspace(line[1]));
}
Index: usr.bin/hexdump/parse.c
================================================== =================
RCS file: /cvs/src/usr.bin/hexdump/parse.c,v
retrieving revision 1.15
diff -u -p -r1.15 parse.c
--- usr.bin/hexdump/parse.c 23 Aug 2006 03:13:09 -0000 1.15
+++ usr.bin/hexdump/parse.c 10 Nov 2006 14:13:19 -0000
@@ -72,7 +72,7 @@ addfile(char *name)
lbuf[len] = '\0';
buf = lbuf;
}
- for (p = buf; *p && isspace((unsigned char)*p); ++p);
+ for (p = buf; isspace((unsigned char)*p); ++p);
if (!*p || *p == '#')
continue;
add(p);
Index: usr.bin/less/tags.c
================================================== =================
RCS file: /cvs/src/usr.bin/less/tags.c,v
retrieving revision 1.6
diff -u -p -r1.6 tags.c
--- usr.bin/less/tags.c 10 Oct 2006 19:54:06 -0000 1.6
+++ usr.bin/less/tags.c 10 Nov 2006 14:16:09 -0000
@@ -715,7 +715,7 @@ getentry(buf, tag, file, line)
if (*p == 0)
return (-1);
*p++ = 0;
- for ( ; *p && isspace(*p); p++) /* (skip blanks) */
+ for ( ; isspace(*p); p++) /* (skip blanks) */
;
if (*p == 0)
return (-1);
@@ -727,7 +727,7 @@ getentry(buf, tag, file, line)
{
for ( ; *p && !isspace(*p); p++) /* (skip tag type) */
;
- for (; *p && isspace(*p); p++) /* (skip blanks) */
+ for (; isspace(*p); p++) /* (skip blanks) */
;
}
if (!isdigit(*p))
@@ -738,7 +738,7 @@ getentry(buf, tag, file, line)
if (*p == 0)
return (-1);
*p++ = 0;
- for ( ; *p && isspace(*p); p++) /* (skip blanks) */
+ for ( ; isspace(*p); p++) /* (skip blanks) */
;
if (*p == 0)
return (-1);
Index: usr.bin/make/arch.c
================================================== =================
RCS file: /cvs/src/usr.bin/make/arch.c,v
retrieving revision 1.55
diff -u -p -r1.55 arch.c
--- usr.bin/make/arch.c 20 Jan 2006 23:10:19 -0000 1.55
+++ usr.bin/make/arch.c 10 Nov 2006 14:18:05 -0000
@@ -261,7 +261,7 @@ Arch_ParseArchive(char **linePtr, /* P
* a close paren). */
bool doSubst = false; /* true if need to substitute in memberName */

- while (*cp != '\0' && *cp != ')' && isspace(*cp))
+ while (isspace(*cp))
cp++;
memberName = cp;
while (*cp != '\0' && *cp != ')' && !isspace(*cp)) {
@@ -383,7 +383,7 @@ Arch_ParseArchive(char **linePtr, /* P
* entrance to the loop, cp is guaranteed to point at a ')') */
do {
cp++;
- } while (*cp != '\0' && isspace(*cp));
+ } while (isspace(*cp));

*linePtr = cp;
return true;
Index: usr.bin/make/cond.c
================================================== =================
RCS file: /cvs/src/usr.bin/make/cond.c,v
retrieving revision 1.31
diff -u -p -r1.31 cond.c
--- usr.bin/make/cond.c 20 Jan 2006 23:10:19 -0000 1.31
+++ usr.bin/make/cond.c 10 Nov 2006 14:18:54 -0000
@@ -611,7 +611,7 @@ CondHandleDefault(bool doEval)
/* A variable is empty when it just contains
* spaces... 4/15/92, christos */
char *p;
- for (p = val; *p && isspace(*p); p++)
+ for (p = val; isspace(*p); p++)
continue;
t = *p == '\0' ? True : False;
}
Index: usr.bin/make/for.c
================================================== =================
RCS file: /cvs/src/usr.bin/make/for.c,v
retrieving revision 1.30
diff -u -p -r1.30 for.c
--- usr.bin/make/for.c 7 Apr 2004 13:11:36 -0000 1.30
+++ usr.bin/make/for.c 10 Nov 2006 14:30:17 -0000
@@ -139,7 +139,7 @@ For_Eval(const char *line)
For *arg;
unsigned long n;

- while (*ptr && isspace(*ptr))
+ while (isspace(*ptr))
ptr++;

/* Parse loop. */
@@ -157,7 +157,7 @@ For_Eval(const char *line)
return 0;
}
endVar = ptr++;
- while (*ptr && isspace(*ptr))
+ while (isspace(*ptr))
ptr++;
/* End of variable list ? */
if (endVar - wrd == 2 && wrd[0] == 'i' && wrd[1] == 'n')
@@ -204,7 +204,7 @@ For_Accumulate(For *arg, const char *lin

if (*ptr == '.') {

- for (ptr++; *ptr && isspace(*ptr); ptr++)
+ for (ptr++; isspace(*ptr); ptr++)
continue;

if (strncmp(ptr, "endfor", 6) == 0 &&
Index: usr.bin/make/parse.c
================================================== =================
RCS file: /cvs/src/usr.bin/make/parse.c,v
retrieving revision 1.69
diff -u -p -r1.69 parse.c
--- usr.bin/make/parse.c 7 Apr 2004 13:11:36 -0000 1.69
+++ usr.bin/make/parse.c 10 Nov 2006 14:32:58 -0000
@@ -837,7 +837,7 @@ ParseDoDependency(char *line) /* the lin
Parse_Error(PARSE_WARNING, "Extra target ignored");
}
} else {
- while (*cp && isspace(*cp)) {
+ while (isspace(*cp)) {
cp++;
}
}
@@ -884,7 +884,7 @@ ParseDoDependency(char *line) /* the lin
/*
* Get to the first source
*/
- while (*cp && isspace(*cp)) {
+ while (isspace(*cp)) {
cp++;
}
line = cp;
@@ -996,7 +996,7 @@ ParseDoDependency(char *line) /* the lin
if (savec != '\0') {
cp++;
}
- while (*cp && isspace(*cp)) {
+ while (isspace(*cp)) {
cp++;
}
line = cp;
@@ -1046,7 +1046,7 @@ ParseDoDependency(char *line) /* the lin

ParseDoSrc(tOp, line);
}
- while (*cp && isspace(*cp)) {
+ while (isspace(*cp)) {
cp++;
}
line = cp;
@@ -1361,7 +1361,7 @@ ParseIsCond(Buffer linebuf, Buffer copy,

char *stripped;

- while (*line != '\0' && isspace(*line))
+ while (isspace(*line))
line++;

/* The line might be a conditional. Ask the conditional module
@@ -1372,7 +1372,7 @@ ParseIsCond(Buffer linebuf, Buffer copy,
do {
line = Parse_ReadNextConditionalLine(linebuf);
if (line != NULL) {
- while (*line != '\0' && isspace(*line))
+ while (isspace(*line))
line++;
stripped = strip_comments(copy, line);
}
@@ -1408,7 +1408,7 @@ ParseIsCond(Buffer linebuf, Buffer copy,
char *cp;

line+=5;
- while (*line != '\0' && isspace(*line))
+ while (isspace(*line))
line++;
for (cp = line; !isspace(*cp) && *cp != '\0'
cp++;
Index: usr.bin/man/config.c
================================================== =================
RCS file: /cvs/src/usr.bin/man/config.c,v
retrieving revision 1.7
diff -u -p -r1.7 config.c
--- usr.bin/man/config.c 17 Oct 2005 19:08:46 -0000 1.7
+++ usr.bin/man/config.c 10 Nov 2006 16:42:45 -0000
@@ -88,7 +88,7 @@ config(char *fname)
p[len - 1] = '\0'; /* Terminate the line. */

/* Skip leading space. */
- while (*p != '\0' && isspace(*p))
+ while (isspace(*p))
p++;
/* Skip empty/comment lines. */
if (*p == '\0' || *p == '#')
@@ -114,7 +114,7 @@ config(char *fname)
* has only a single token on it.
*/
if (!strcmp(p, "_build")) {
- while (*++t && isspace(*t));
+ while (isspace(*++t));
if ((ep = malloc(sizeof(ENTRY))) == NULL ||
(ep->s = strdup(t)) == NULL)
err(1, NULL);
Index: usr.bin/newsyslog/newsyslog.c
================================================== =================
RCS file: /cvs/src/usr.bin/newsyslog/newsyslog.c,v
retrieving revision 1.82
diff -u -p -r1.82 newsyslog.c
--- usr.bin/newsyslog/newsyslog.c 14 Sep 2004 22:25:33 -0000 1.82
+++ usr.bin/newsyslog/newsyslog.c 10 Nov 2006 16:45:10 -0000
@@ -938,7 +938,9 @@ age_old_log(struct conf_entry *ent)
char *
sob(char *p)
{
- while (p && *p && isspace(*p))
+ if (p == NULL)
+ return(p);
+ while (isspace(*p))
p++;
return (p);
}
Index: usr.bin/passwd/new_pwd.c
================================================== =================
RCS file: /cvs/src/usr.bin/passwd/new_pwd.c,v
retrieving revision 1.6
diff -u -p -r1.6 new_pwd.c
--- usr.bin/passwd/new_pwd.c 1 May 2005 02:56:28 -0000 1.6
+++ usr.bin/passwd/new_pwd.c 12 Nov 2006 13:41:50 -0000
@@ -73,7 +73,7 @@ check_pw(char *pword)
return "That password collides with a system feature. Choose another.\n";

/* Don't allow all lower case passwords regardless of length */
- for (t = pword; *t && islower(*t); t++)
+ for (t = pword; islower(*t); t++)
;
if (*t == 0)
return "Please don't use an all-lower case password.\n"
Index: usr.bin/sed/compile.c
================================================== =================
RCS file: /cvs/src/usr.bin/sed/compile.c,v
retrieving revision 1.22
diff -u -p -r1.22 compile.c
--- usr.bin/sed/compile.c 9 Oct 2006 00:23:56 -0000 1.22
+++ usr.bin/sed/compile.c 10 Nov 2006 16:46:58 -0000
@@ -139,7 +139,7 @@ compile(void)

#define EATSPACE() do { \
if (p) \
- while (*p && isascii(*p) && isspace(*p)) \
+ while (isascii(*p) && isspace(*p)) \
p++; \
} while (0)

Index: usr.bin/ssh/clientloop.c
================================================== =================
RCS file: /cvs/src/usr.bin/ssh/clientloop.c,v
retrieving revision 1.176
diff -u -p -r1.176 clientloop.c
--- usr.bin/ssh/clientloop.c 11 Oct 2006 12:38:03 -0000 1.176
+++ usr.bin/ssh/clientloop.c 10 Nov 2006 17:48:23 -0000
@@ -921,7 +921,7 @@ process_cmdline(void)
cmd = s = read_passphrase("\r\nssh> ", RP_ECHO);
if (s == NULL)
goto out;
- while (*s && isspace(*s))
+ while (isspace(*s))
s++;
if (*s == '-')
s++; /* Skip cmdline '-', if any */
@@ -968,9 +968,8 @@ process_cmdline(void)
goto out;
}

- s++;
- while (*s && isspace(*s))
- s++;
+ while (isspace(*++s))
+ ;

if (delete) {
cancel_port = 0;
Index: usr.bin/ssh/readconf.c
================================================== =================
RCS file: /cvs/src/usr.bin/ssh/readconf.c,v
retrieving revision 1.159
diff -u -p -r1.159 readconf.c
--- usr.bin/ssh/readconf.c 3 Aug 2006 03:34:42 -0000 1.159
+++ usr.bin/ssh/readconf.c 10 Nov 2006 17:48:55 -0000
@@ -1219,7 +1219,7 @@ parse_forward(Forward *fwd, const char *
cp = p = xstrdup(fwdspec);

/* skip leading spaces */
- while (*cp && isspace(*cp))
+ while (isspace(*cp))
cp++;

for (i = 0; i < 4; ++i)
Index: usr.bin/systat/cmds.c
================================================== =================
RCS file: /cvs/src/usr.bin/systat/cmds.c,v
retrieving revision 1.13
diff -u -p -r1.13 cmds.c
--- usr.bin/systat/cmds.c 31 Mar 2006 04:10:59 -0000 1.13
+++ usr.bin/systat/cmds.c 10 Nov 2006 17:49:28 -0000
@@ -62,7 +62,7 @@ command(char *cmd)
*cp++ = '\0';
if (*cmd == '\0')
return;
- for (; *cp && isspace(*cp); cp++)
+ for (; isspace(*cp); cp++)
;
if (strcmp(cmd, "quit") == 0 || strcmp(cmd, "q") == 0)
die();
Index: usr.bin/systat/disks.c
================================================== =================
RCS file: /cvs/src/usr.bin/systat/disks.c,v
retrieving revision 1.15
diff -u -p -r1.15 disks.c
--- usr.bin/systat/disks.c 31 Mar 2006 04:10:59 -0000 1.15
+++ usr.bin/systat/disks.c 10 Nov 2006 17:49:56 -0000
@@ -78,7 +78,7 @@ dkselect(char *args, int truefalse, int
if (cp)
*cp = '\0';
for (; {
- for (cp = args; *cp && isspace(*cp); cp++)
+ for (cp = args; isspace(*cp); cp++)
;
args = cp;
for (; *cp && !isspace(*cp); cp++)
Index: usr.bin/systat/netcmds.c
================================================== =================
RCS file: /cvs/src/usr.bin/systat/netcmds.c,v
retrieving revision 1.16
diff -u -p -r1.16 netcmds.c
--- usr.bin/systat/netcmds.c 31 Mar 2006 04:10:59 -0000 1.16
+++ usr.bin/systat/netcmds.c 10 Nov 2006 17:50:36 -0000
@@ -131,7 +131,7 @@ changeitems(char *args, int onoff)
if (cp)
*cp = '\0';
for (;;args = cp) {
- for (cp = args; *cp && isspace(*cp); cp++)
+ for (cp = args; isspace(*cp); cp++)
;
args = cp;
for (; *cp && !isspace(*cp); cp++)
Index: usr.bin/tset/termcap.c
================================================== =================
RCS file: /cvs/src/usr.bin/tset/termcap.c,v
retrieving revision 1.5
diff -u -p -r1.5 termcap.c
--- usr.bin/tset/termcap.c 3 Jun 2003 02:56:20 -0000 1.5
+++ usr.bin/tset/termcap.c 10 Nov 2006 17:54:28 -0000
@@ -175,9 +175,9 @@ wrtermcap(bp)
* empty fields or fields containing only whitespace.
*/
while ((p = strsep(&t, ":")) != NULL) {
- while ((ch = *p) != '\0' && isspace(ch))
+ while (isspace(*p))
++p;
- if (ch == '\0')
+ if (*p == '\0')
continue;
while ((ch = *p++) != '\0')
switch(ch) {
Index: usr.bin/vacation/vacation.c
================================================== =================
RCS file: /cvs/src/usr.bin/vacation/vacation.c,v
retrieving revision 1.24
diff -u -p -r1.24 vacation.c
--- usr.bin/vacation/vacation.c 14 Aug 2006 15:49:28 -0000 1.24
+++ usr.bin/vacation/vacation.c 10 Nov 2006 17:56:00 -0000
@@ -227,7 +227,7 @@ readheaders(void)
sizeof("Return-Path:")-1) ||
(buf[12] != ' ' && buf[12] != '\t'))
break;
- for (p = buf + 12; *p && isspace(*p); ++p)
+ for (p = buf + 12; isspace(*p); ++p)
;
if (strlcpy(from, p, sizeof(from)) >= sizeof(from)) {
syslog(LOG_NOTICE,
@@ -248,7 +248,7 @@ readheaders(void)
break;
if (!(p = strchr(buf, ':')))
break;
- while (*++p && isspace(*p))
+ while (isspace(*++p))
;
if (!*p)
break;
@@ -264,7 +264,7 @@ readheaders(void)
sizeof("Subject:")-1) ||
(buf[8] != ' ' && buf[8] != '\t'))
break;
- for (p = buf + 8; *p && isspace(*p); ++p)
+ for (p = buf + 8; isspace(*p); ++p)
;
if (strlcpy(subj, p, sizeof(subj)) >= sizeof(subj)) {
syslog(LOG_NOTICE,
Index: usr.bin/vi/common/msg.c
================================================== =================
RCS file: /cvs/src/usr.bin/vi/common/msg.c,v
retrieving revision 1.16
diff -u -p -r1.16 msg.c
--- usr.bin/vi/common/msg.c 11 Mar 2006 06:58:00 -0000 1.16
+++ usr.bin/vi/common/msg.c 11 Nov 2006 14:17:54 -0000
@@ -202,7 +202,7 @@ retry: FREE_SPACE(sp, bp, blen);
++p;
continue;
}
- for (u = p; *++p != '\0' && isdigit(*p);
+ for (u = p; isdigit(*p);
if (*p != '$')
continue;

Index: usr.bin/vi/ex/ex_cscope.c
================================================== =================
RCS file: /cvs/src/usr.bin/vi/ex/ex_cscope.c,v
retrieving revision 1.12
diff -u -p -r1.12 ex_cscope.c
--- usr.bin/vi/ex/ex_cscope.c 8 Jan 2006 21:05:40 -0000 1.12
+++ usr.bin/vi/ex/ex_cscope.c 11 Nov 2006 13:38:57 -0000
@@ -137,7 +137,7 @@ ex_cscope(sp, cmdp)
break;
if (*p != '\0') {
*p++ = '\0';
- for (; *p && isspace(*p); ++p);
+ for (; isspace(*p); ++p);
}

if ((ccp = lookup_ccmd(cmd)) == NULL) {
@@ -613,7 +613,7 @@ create_cs_cmd(sp, pattern, searchp)
}

/* Skip <blank> characters to the pattern. */
- for (p = pattern + 1; *p != '\0' && isblank(*p); ++p);
+ for (p = pattern + 1; isblank(*p); ++p);
if (*p == '\0') {
usage: (void)csc_help(sp, "find");
return (NULL);
Index: usr.bin/vi/ex/ex_write.c
================================================== =================
RCS file: /cvs/src/usr.bin/vi/ex/ex_write.c,v
retrieving revision 1.9
diff -u -p -r1.9 ex_write.c
--- usr.bin/vi/ex/ex_write.c 30 May 2006 19:43:27 -0000 1.9
+++ usr.bin/vi/ex/ex_write.c 11 Nov 2006 13:40:07 -0000
@@ -151,7 +151,7 @@ exwr(sp, cmdp, cmd)

/* Skip any leading whitespace. */
if (cmdp->argc != 0)
- for (p = cmdp->argv[0]->bp; *p != '\0' && isblank(*p); ++p)
+ for (p = cmdp->argv[0]->bp; isblank(*p); ++p)
;

/* If "write !" it's a pipe to a utility. */
@@ -163,7 +163,7 @@ exwr(sp, cmdp, cmd)
}

/* Expand the argument. */
- for (++p; *p && isblank(*p); ++p);
+ for (++p; isblank(*p); ++p);
if (*p == '\0') {
ex_emsg(sp, cmdp->cmd->usage, EXM_USAGE);
return (1);
@@ -204,7 +204,7 @@ exwr(sp, cmdp, cmd)
LF_SET(FS_APPEND);

/* Skip ">>" and whitespace. */
- for (p += 2; *p && isblank(*p); ++p);
+ for (p += 2; isblank(*p); ++p);
}

/* If no other arguments, just write the file back. */
Index: usr.bin/whatis/whatis.c
================================================== =================
RCS file: /cvs/src/usr.bin/whatis/whatis.c,v
retrieving revision 1.11
diff -u -p -r1.11 whatis.c
--- usr.bin/whatis/whatis.c 2 Apr 2006 21:38:56 -0000 1.11
+++ usr.bin/whatis/whatis.c 11 Nov 2006 13:06:19 -0000
@@ -185,7 +185,7 @@ match(char *bp, char *str)
break;

/* check for word match first */
- for (start = bp++; *bp && (*bp == '_' || isalnum(*bp)); ++bp)
+ for (start = bp++; *bp == '_' || isalnum(*bp); ++bp)
;
if (bp - start == len) {
if (strncasecmp(start, str, len) == 0)
Index: usr.bin/xlint/lint1/emit1.c
================================================== =================
RCS file: /cvs/src/usr.bin/xlint/lint1/emit1.c,v
retrieving revision 1.6
diff -u -p -r1.6 emit1.c
--- usr.bin/xlint/lint1/emit1.c 29 Nov 2005 19:38:09 -0000 1.6
+++ usr.bin/xlint/lint1/emit1.c 12 Nov 2006 13:17:09 -0000
@@ -489,7 +489,7 @@ outfstrg(strg_t *strg)
}

/* numeric field width */
- while (c != '\0' && isdigit(c)) {
+ while (isdigit(c)) {
outqchar(c);
c = *cp++;
}
@@ -501,7 +501,7 @@ outfstrg(strg_t *strg)
outqchar(c);
c = *cp++;
} else {
- while (c != '\0' && isdigit(c)) {
+ while (isdigit(c)) {
outqchar(c);
c = *cp++;
}
Index: usr.sbin/afs/src/lib/ko/kocell.c
================================================== =================
RCS file: /cvs/src/usr.sbin/afs/src/lib/ko/kocell.c,v
retrieving revision 1.7
diff -u -p -r1.7 kocell.c
--- usr.sbin/afs/src/lib/ko/kocell.c 16 Dec 2003 20:13:55 -0000 1.7
+++ usr.sbin/afs/src/lib/ko/kocell.c 10 Nov 2006 17:57:46 -0000
@@ -429,7 +429,7 @@ readdb (char *line, cell_entry* c, int *
return -1;
}

- while (*line && isspace((unsigned char)*line))
+ while (isspace((unsigned char)*line))
++line;

if (inet_aton (line, &numaddr) == 0) {
@@ -487,7 +487,7 @@ readcellservdb (const char *filename)
++lineno;
i = 0;
line[strcspn(line, "\n")] = '\0';
- while (line[0] && isspace((unsigned char)line[i]))
+ while (isspace((unsigned char)line[i]))
i++;
if (line[i] == '#' || line[i] == '\0')
continue;
Index: usr.sbin/afs/src/milko/bos/kconf.c
================================================== =================
RCS file: /cvs/src/usr.sbin/afs/src/milko/bos/kconf.c,v
retrieving revision 1.3
diff -u -p -r1.3 kconf.c
--- usr.sbin/afs/src/milko/bos/kconf.c 5 Aug 2003 09:16:15 -0000 1.3
+++ usr.sbin/afs/src/milko/bos/kconf.c 8 Nov 2006 13:37:00 -0000
@@ -136,8 +136,6 @@ parse_list(FILE *f, unsigned *lineno, kc
++p;
if (*p == '#' || *p == ';' || *p == '\0')
continue;
- while(isspace((unsigned char)*p))
- ++p;
if (*p == '}')
return 0;
if (*p == '\0')
Index: usr.sbin/afs/src/tools/release-tools/common.c
================================================== =================
RCS file: /cvs/src/usr.sbin/afs/src/tools/release-tools/common.c,v
retrieving revision 1.1.1.1
diff -u -p -r1.1.1.1 common.c
--- usr.sbin/afs/src/tools/release-tools/common.c 5 Aug 2003 08:21:08
-0000 1.1.1.1
+++ usr.sbin/afs/src/tools/release-tools/common.c 10 Nov 2006 17:58:41 -0000
@@ -63,7 +63,7 @@ estrntoll(const char *str, size_t len, i
num = strtol(p, &endptr, base);
#endif

- while(*endptr != '\0' && isspace((int)*endptr))
+ while(isspace((int)*endptr))
endptr++;

if (*endptr != '\0')
Index: usr.sbin/afs/src/util/log.c
================================================== =================
RCS file: /cvs/src/usr.sbin/afs/src/util/log.c,v
retrieving revision 1.10
diff -u -p -r1.10 log.c
--- usr.sbin/afs/src/util/log.c 2 May 2005 17:51:37 -0000 1.10
+++ usr.sbin/afs/src/util/log.c 10 Nov 2006 18:00:17 -0000
@@ -632,7 +632,7 @@ parse_word (Log_method *m, char **str, L
char *first;

if (**str == '\0') return 1;
- while (**str != '\0' && (isspace((unsigned char)**str) || **str == ';'))
+ while (isspace((unsigned char)**str) || **str == ';')
(*str)++;
if (**str == '\0') return 1;

Index: usr.sbin/amd/amd/amq_subr.c
================================================== =================
RCS file: /cvs/src/usr.sbin/amd/amd/amq_subr.c,v
retrieving revision 1.11
diff -u -p -r1.11 amq_subr.c
--- usr.sbin/amd/amd/amq_subr.c 18 Feb 2005 15:51:02 -0000 1.11
+++ usr.sbin/amd/amd/amq_subr.c 10 Nov 2006 18:00:47 -0000
@@ -215,7 +215,7 @@ struct svc_req *rqstp;
/*
* Find start of value
*/
- while (*cp && isascii(*cp) && isspace(*cp))
+ while (isascii(*cp) && isspace(*cp))
cp++;

root_newmap(s, cp, (char *) 0);
Index: usr.sbin/amd/amd/info_file.c
================================================== =================
RCS file: /cvs/src/usr.sbin/amd/amd/info_file.c,v
retrieving revision 1.5
diff -u -p -r1.5 info_file.c
--- usr.sbin/amd/amd/info_file.c 2 Jun 2003 23:36:51 -0000 1.5
+++ usr.sbin/amd/amd/info_file.c 10 Nov 2006 18:01:29 -0000
@@ -119,7 +119,7 @@ search_or_reload_file(FILE *fp, char *ma
/*
* Find start of key
*/
- for (kp = key_val; *kp && isascii(*kp) && isspace(*kp); kp++)
+ for (kp = key_val; isascii(*kp) && isspace(*kp); kp++)
;

/*
@@ -141,7 +141,7 @@ search_or_reload_file(FILE *fp, char *ma
*cp++ = '\0';

if (fn || (*key == *kp && strcmp(key, kp) == 0)) {
- while (*cp && isascii(*cp) && isspace(*cp))
+ while (isascii(*cp) && isspace(*cp))
cp++;
if (*cp) {
/*
Index: usr.sbin/amd/amd/mount_fs.c
================================================== =================
RCS file: /cvs/src/usr.sbin/amd/amd/mount_fs.c,v
retrieving revision 1.9
diff -u -p -r1.9 mount_fs.c
--- usr.sbin/amd/amd/mount_fs.c 2 Jun 2003 23:36:51 -0000 1.9
+++ usr.sbin/amd/amd/mount_fs.c 10 Nov 2006 18:01:53 -0000
@@ -217,7 +217,7 @@ nextmntopt(char **p)
/*
* Skip past white space
*/
- while (*cp && isspace(*cp))
+ while (isspace(*cp))
cp++;
/*
* Word starts here
Index: usr.sbin/amd/mk-amd-map/mk-amd-map.c
================================================== =================
RCS file: /cvs/src/usr.sbin/amd/mk-amd-map/mk-amd-map.c,v
retrieving revision 1.8
diff -u -p -r1.8 mk-amd-map.c
--- usr.sbin/amd/mk-amd-map/mk-amd-map.c 7 May 2004 15:51:12 -0000 1.8
+++ usr.sbin/amd/mk-amd-map/mk-amd-map.c 10 Nov 2006 18:05:12 -0000
@@ -155,7 +155,7 @@ read_file(FILE *fp, char *map, void *db)
/*
* Find start of key
*/
- for (kp = key_val; *kp && isascii(*kp) && isspace(*kp); kp++)
+ for (kp = key_val; isascii(*kp) && isspace(*kp); kp++)
;

/*
@@ -176,7 +176,7 @@ read_file(FILE *fp, char *map, void *db)
*/
if (*cp)
*cp++ = '\0';
- while (*cp && isascii(*cp) && isspace(*cp))
+ while (isascii(*cp) && isspace(*cp))
cp++;
if (*kp == '+') {
fprintf(stderr, "Can't interpolate %s\n", kp);
Index: usr.sbin/bind/bin/nsupdate/nsupdate.c
================================================== =================
RCS file: /cvs/src/usr.sbin/bind/bin/nsupdate/nsupdate.c,v
retrieving revision 1.5
diff -u -p -r1.5 nsupdate.c
--- usr.sbin/bind/bin/nsupdate/nsupdate.c 5 Apr 2006 17:36:33 -0000 1.5
+++ usr.sbin/bind/bin/nsupdate/nsupdate.c 10 Nov 2006 18:05:42 -0000
@@ -720,7 +720,7 @@ parse_rdata(char **cmdlinep, dns_rdatacl
dns_rdatacallbacks_t callbacks;
isc_result_t result;

- while (*cmdline != 0 && isspace((unsigned char)*cmdline))
+ while (isspace((unsigned char)*cmdline))
cmdline++;

if (*cmdline != 0) {
Index: usr.sbin/bind/lib/dns/ttl.c
================================================== =================
RCS file: /cvs/src/usr.sbin/bind/lib/dns/ttl.c,v
retrieving revision 1.4
diff -u -p -r1.4 ttl.c
--- usr.sbin/bind/lib/dns/ttl.c 19 Apr 2005 17:15:53 -0000 1.4
+++ usr.sbin/bind/lib/dns/ttl.c 12 Nov 2006 13:18:18 -0000
@@ -165,7 +165,7 @@ bind_ttl(isc_textregion_t *source, isc_u
isc_result_t result;

char *np = nbuf;
- while (*s != '\0' && isdigit((unsigned char)*s))
+ while (isdigit((unsigned char)*s))
*np++ = *s++;
*np++ = '\0';
INSIST(np - nbuf <= (int)sizeof(nbuf));
Index: usr.sbin/bind/lib/isc/string.c
================================================== =================
RCS file: /cvs/src/usr.sbin/bind/lib/isc/string.c,v
retrieving revision 1.4
diff -u -p -r1.4 string.c
--- usr.sbin/bind/lib/isc/string.c 22 Mar 2005 16:52:39 -0000 1.4
+++ usr.sbin/bind/lib/isc/string.c 10 Nov 2006 18:06:41 -0000
@@ -38,7 +38,7 @@ isc_string_touint64(char *source, char *
return (0);
}

- while (*s != 0 && isascii(*s&0xff) && isspace(*s&0xff))
+ while (isascii(*s&0xff) && isspace(*s&0xff))
s++;
if (*s == '+' /* || *s == '-' */)
s++;
Index: usr.sbin/catman/catman.c
================================================== =================
RCS file: /cvs/src/usr.sbin/catman/catman.c,v
retrieving revision 1.7
diff -u -p -r1.7 catman.c
--- usr.sbin/catman/catman.c 28 Jun 2003 20:37:29 -0000 1.7
+++ usr.sbin/catman/catman.c 12 Nov 2006 13:19:09 -0000
@@ -138,7 +138,7 @@ catman(const char *path, char *section)
if (isdigit(*tmp)) {
sectlen++;
tmp++;
- while (*tmp && isdigit(*tmp) == 0) {
+ while (isdigit(*tmp) == 0) {
sectlen++;
tmp++;
}
Index: usr.sbin/config/cmd.c
================================================== =================
RCS file: /cvs/src/usr.sbin/config/cmd.c,v
retrieving revision 1.13
diff -u -p -r1.13 cmd.c
--- usr.sbin/config/cmd.c 8 Jun 2004 20:59:28 -0000 1.13
+++ usr.sbin/config/cmd.c 10 Nov 2006 18:07:32 -0000
@@ -269,7 +269,7 @@ Xtimezone(cmd_t *cmd)
c = cmd->args;
while ((*c != '\0') && !isspace(*c))
c++;
- while ((*c != '\0') && isspace(*c))
+ while (isspace(*c))
c++;
if (strlen(c) != 0 && number(c, &num) == 0)
tz->tz_dsttime = num;
Index: usr.sbin/faithd/ftp.c
================================================== =================
RCS file: /cvs/src/usr.sbin/faithd/ftp.c,v
retrieving revision 1.14
diff -u -p -r1.14 ftp.c
--- usr.sbin/faithd/ftp.c 16 Mar 2005 05:07:48 -0000 1.14
+++ usr.sbin/faithd/ftp.c 10 Nov 2006 18:08:26 -0000
@@ -395,7 +395,7 @@ ftp_copyresult(int src, int dst, enum st
code = atoi(rbuf);
param = p;
/* param points to first non-command token, if any */
- while (*param && isspace(*param))
+ while (isspace(*param))
param++;
if (!*param)
param = NULL;
@@ -635,7 +635,7 @@ ftp_copycommand(int src, int dst, enum s
*q = '\0';
param = p;
/* param points to first non-command token, if any */
- while (*param && isspace(*param))
+ while (isspace(*param))
param++;
if (!*param)
param = NULL;
Index: usr.sbin/httpd/src/main/util.c
================================================== =================
RCS file: /cvs/src/usr.sbin/httpd/src/main/util.c,v
retrieving revision 1.19
diff -u -p -r1.19 util.c
--- usr.sbin/httpd/src/main/util.c 20 Jan 2006 00:21:43 -0000 1.19
+++ usr.sbin/httpd/src/main/util.c 10 Nov 2006 18:10:27 -0000
@@ -750,7 +750,7 @@ API_EXPORT(char *) ap_getword_conf(pool
char *res;
char quote;

- while (*str && ap_isspace(*str))
+ while (ap_isspace(*str))
++str;

if (!*str) {
@@ -782,7 +782,7 @@ API_EXPORT(char *) ap_getword_conf(pool
res = substring_conf(p, str, strend - str, 0);
}

- while (*strend && ap_isspace(*strend))
+ while (ap_isspace(*strend))
++strend;
*line = strend;
return res;
@@ -1314,7 +1314,7 @@ API_EXPORT(char *) ap_get_token(pool *p,

/* Find first non-white byte */

- while (*ptr && ap_isspace(*ptr))
+ while (ap_isspace(*ptr))
++ptr;

tok_start = ptr;
@@ -1336,7 +1336,7 @@ API_EXPORT(char *) ap_get_token(pool *p,

/* Advance accept_line pointer to the next non-white byte */

- while (*ptr && ap_isspace(*ptr))
+ while (ap_isspace(*ptr))
++ptr;

*accept_line = ptr;
Index: usr.sbin/httpd/src/main/util_date.c
================================================== =================
RCS file: /cvs/src/usr.sbin/httpd/src/main/util_date.c,v
retrieving revision 1.6
diff -u -p -r1.6 util_date.c
--- usr.sbin/httpd/src/main/util_date.c 21 Aug 2003 13:11:35 -0000 1.6
+++ usr.sbin/httpd/src/main/util_date.c 10 Nov 2006 18:11:10 -0000
@@ -232,7 +232,7 @@ API_EXPORT(time_t) ap_parseHTTPdate(cons
if (!date)
return BAD_DATE;

- while (*date && ap_isspace(*date)) /* Find first non-whitespace char */
+ while (ap_isspace(*date)) /* Find first non-whitespace char */
++date;

if (*date == '\0')
Index: usr.sbin/httpd/src/main/util_script.c
================================================== =================
RCS file: /cvs/src/usr.sbin/httpd/src/main/util_script.c,v
retrieving revision 1.15
diff -u -p -r1.15 util_script.c
--- usr.sbin/httpd/src/main/util_script.c 9 Feb 2005 12:13:10 -0000 1.15
+++ usr.sbin/httpd/src/main/util_script.c 10 Nov 2006 18:11:52 -0000
@@ -504,7 +504,7 @@ API_EXPORT(int) ap_scan_script_header_er
}

*l++ = '\0';
- while (*l && ap_isspace(*l)) {
+ while (ap_isspace(*l)) {
++l;
}

Index: usr.sbin/httpd/src/modules/proxy/proxy_cache.c
================================================== =================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/proxy/proxy_cache.c,v
retrieving revision 1.18
diff -u -p -r1.18 proxy_cache.c
--- usr.sbin/httpd/src/modules/proxy/proxy_cache.c 9 Feb 2005 12:13:10
-0000 1.18
+++ usr.sbin/httpd/src/modules/proxy/proxy_cache.c 10 Nov 2006 18:12:58 -0000
@@ -997,7 +997,7 @@ int ap_proxy_cache_check(request_rec *r,
/* isolate header name */
while (*vary && !ap_isspace(*vary) && (*vary != ','))
++vary;
- while (*vary && (ap_isspace(*vary) || (*vary == ','))) {
+ while (ap_isspace(*vary) || (*vary == ',')) {
*vary = '\0';
++vary;
}
Index: usr.sbin/httpd/src/modules/proxy/proxy_util.c
================================================== =================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/proxy/proxy_util.c,v
retrieving revision 1.15
diff -u -p -r1.15 proxy_util.c
--- usr.sbin/httpd/src/modules/proxy/proxy_util.c 9 Feb 2005 12:13:10
-0000 1.15
+++ usr.sbin/httpd/src/modules/proxy/proxy_util.c 10 Nov 2006 18:14:06 -0000
@@ -1373,7 +1373,7 @@ void ap_proxy_clear_connection(pool *p,
name = next;
while (*next && !ap_isspace(*next) && (*next != ','))
++next;
- while (*next && (ap_isspace(*next) || (*next == ','))) {
+ while (ap_isspace(*next) || (*next == ',')) {
*next = '\0';
++next;
}
Index: usr.sbin/httpd/src/modules/standard/mod_imap.c
================================================== =================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_imap.c,v
retrieving revision 1.8
diff -u -p -r1.8 mod_imap.c
--- usr.sbin/httpd/src/modules/standard/mod_imap.c 20 Jan 2006 00:21:43
-0000 1.8
+++ usr.sbin/httpd/src/modules/standard/mod_imap.c 10 Nov 2006 18:15:27 -0000
@@ -699,7 +699,7 @@ static int imap_handler(request_rec *r)
if (!*string_pos) { /* need at least two fields */
goto need_2_fields;
}
- while(*string_pos && ap_isspace(*string_pos)) { /* past whitespace */
+ while(ap_isspace(*string_pos)) { /* past whitespace */
++string_pos;
}

Index: usr.sbin/httpd/src/modules/standard/mod_negotiation.c
================================================== =================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_negotiation.c,v
retrieving revision 1.8
diff -u -p -r1.8 mod_negotiation.c
--- usr.sbin/httpd/src/modules/standard/mod_negotiation.c 9 Feb 2005
12:13:10 -0000 1.8
+++ usr.sbin/httpd/src/modules/standard/mod_negotiation.c 10 Nov 2006
18:17:34 -0000
@@ -369,7 +369,7 @@ static const char *get_entry(pool *p, ac
}

*cp++ = '\0'; /* Delimit var */
- while (*cp && (ap_isspace(*cp) || *cp == '=')) {
+ while (ap_isspace(*cp) || *cp == '=') {
++cp;
}

@@ -652,7 +652,7 @@ static enum header_state get_header_line

/* If blank, just return it --- this ends information on this variant */

- for (cp = buffer; (*cp && ap_isspace(*cp)); ++cp) {
+ for (cp = buffer; ap_isspace(*cp); ++cp) {
continue;
}

@@ -758,7 +758,7 @@ static char *lcase_header_name_return_bo

do {
++cp;
- } while (*cp && ap_isspace(*cp));
+ } while (ap_isspace(*cp));

if (!*cp) {
ap_log_rerror(APLOG_MARK, APLOG_NOERRNO|APLOG_ERR, r,

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply


Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 09:38 PM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
UnixAdminTalk.com

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423 424 425 426 427 428 429 430 431 432 433 434 435 436 437 438 439 440 441 442 443 444