INN commit: trunk (47 files)
INN Commit
rra at isc.org
Fri Mar 19 21:27:15 UTC 2010
Date: Friday, March 19, 2010 @ 14:27:15
Author: iulius
Revision: 9019
Assume STDC_HEADERS is always true nowadays.
CTYPE is no longer useful; yet, as Russ Allbery hints at, we keep the
cast because it remains the case that passing signed characters into is*()
functions can cause problems on some platforms. Some implementations do
straight table lookups and, if given what they think is a negative number,
will happily dereference memory off the beginning of the table.
Modified:
trunk/backends/innxmit.c
trunk/backends/ninpaths.c
trunk/configure.ac
trunk/expire/convdate.c
trunk/expire/expire.c
trunk/expire/fastrm.c
trunk/frontends/ctlinnd.c
trunk/frontends/inews.c
trunk/frontends/rnews.c
trunk/frontends/sys2nf.c
trunk/include/clibrary.h
trunk/innd/art.c
trunk/innd/cc.c
trunk/innd/keywords.c
trunk/innd/newsfeeds.c
trunk/innd/python.c
trunk/innd/rc.c
trunk/innfeed/configfile.y
trunk/innfeed/imap_connection.c
trunk/innfeed/innlistener.c
trunk/innfeed/misc.c
trunk/innfeed/tape.c
trunk/lib/commands.c
trunk/lib/concat.c
trunk/lib/date.c
trunk/lib/hash.c
trunk/lib/headers.c
trunk/lib/inndcomm.c
trunk/lib/nntp.c
trunk/lib/numbers.c
trunk/m4/sendfd.m4
trunk/nnrpd/article.c
trunk/nnrpd/nnrpd.c
trunk/nnrpd/perm.c
trunk/nnrpd/post.c
trunk/nnrpd/sasl.c
trunk/storage/buffindexed/buffindexed.c
trunk/storage/cnfs/cnfs.c
trunk/storage/expire.c
trunk/storage/interface.c
trunk/storage/ov.c
trunk/storage/overdata.c
trunk/storage/timecaf/timecaf.c
trunk/storage/timehash/timehash.c
trunk/storage/tradindexed/tdx-util.c
trunk/storage/tradspool/tradspool.c
trunk/tests/lib/xmalloc.c
-----------------------------------+
backends/innxmit.c | 2 +-
backends/ninpaths.c | 2 +-
configure.ac | 15 ---------------
expire/convdate.c | 2 +-
expire/expire.c | 4 ++--
expire/fastrm.c | 6 +++---
frontends/ctlinnd.c | 2 +-
frontends/inews.c | 10 +++++-----
frontends/rnews.c | 4 ++--
frontends/sys2nf.c | 2 +-
include/clibrary.h | 32 ++------------------------------
innd/art.c | 4 ++--
innd/cc.c | 10 +++++-----
innd/keywords.c | 4 ++--
innd/newsfeeds.c | 32 ++++++++++++++++----------------
innd/python.c | 6 +++---
innd/rc.c | 4 ++--
innfeed/configfile.y | 6 +++---
innfeed/imap_connection.c | 12 ++++++------
innfeed/innlistener.c | 2 +-
innfeed/misc.c | 20 ++++++++++----------
innfeed/tape.c | 4 ++--
lib/commands.c | 4 ++--
lib/concat.c | 4 +---
lib/date.c | 14 +++++++-------
lib/hash.c | 2 +-
lib/headers.c | 2 +-
lib/inndcomm.c | 4 ++--
lib/nntp.c | 2 +-
lib/numbers.c | 2 +-
m4/sendfd.m4 | 2 +-
nnrpd/article.c | 8 ++++----
nnrpd/nnrpd.c | 2 +-
nnrpd/perm.c | 2 +-
nnrpd/post.c | 4 ++--
nnrpd/sasl.c | 2 +-
storage/buffindexed/buffindexed.c | 6 +++---
storage/cnfs/cnfs.c | 4 ++--
storage/expire.c | 4 ++--
storage/interface.c | 6 +++---
storage/ov.c | 4 ++--
storage/overdata.c | 4 ++--
storage/timecaf/timecaf.c | 16 ++++++++--------
storage/timehash/timehash.c | 24 +++++++++++++-----------
storage/tradindexed/tdx-util.c | 2 +-
storage/tradspool/tradspool.c | 2 +-
tests/lib/xmalloc.c | 2 +-
47 files changed, 135 insertions(+), 178 deletions(-)
Modified: backends/innxmit.c
===================================================================
--- backends/innxmit.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ backends/innxmit.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -207,7 +207,7 @@
hash = 0;
for (p = MessageID + 1; *p && (*p != '>'); p++) {
hash <<= 1;
- if (isascii((int)*p) && isupper((int)*p)) {
+ if (isupper((unsigned char) *p)) {
hash += tolower(*p);
} else {
hash += *p;
Modified: backends/ninpaths.c
===================================================================
--- backends/ninpaths.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ backends/ninpaths.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -372,7 +372,7 @@
c+=6;
/* find end of line. Some broken newsreaders preload Path with
a name containing spaces. Chop off those entries. */
- for (ce=c; *ce && !CTYPE(isspace, *ce); ++ce);
+ for (ce=c; *ce && !isspace((unsigned char) *ce); ++ce);
if (!*ce) {
/* bogus line */
v=0;
Modified: configure.ac
===================================================================
--- configure.ac 2010-03-19 21:24:35 UTC (rev 9018)
+++ configure.ac 2010-03-19 21:27:15 UTC (rev 9019)
@@ -374,21 +374,6 @@
AC_DEFINE([DO_LARGEFILES], [1], [Define to use large files.])
fi
-dnl Start by checking for standard C headers. AC_HEADER_STDC will set
-dnl STDC_HEADERS if stdlib.h, stdarg.h, string.h, and float.h all exist, if
-dnl memchr (and probably the other mem functions) is in string.h, if free (and
-dnl probably malloc and friends) are in stdlib.h, and if ctype.h will work on
-dnl high-bit characters.
-AC_HEADER_STDC
-
-dnl Only if that wasn't set do we need to go hunting for other headers to
-dnl include on non-ANSI systems and check for functions that all ANSI C
-dnl systems should have.
-if test x"$ac_cv_header_stdc" = xno ; then
- AC_CHECK_HEADERS(memory.h stdlib.h strings.h)
- AC_CHECK_FUNCS(memcpy strchr)
-fi
-
dnl Special checks for header files.
AC_HEADER_STDBOOL
AC_HEADER_TIME
Modified: expire/convdate.c
===================================================================
--- expire/convdate.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ expire/convdate.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -39,7 +39,7 @@
isdigits(const char *p)
{
for (; *p; p++)
- if (!CTYPE(isdigit, *p))
+ if (!isdigit((unsigned char) *p))
return false;
return true;
}
Modified: expire/expire.c
===================================================================
--- expire/expire.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ expire/expire.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -154,7 +154,7 @@
break;
SawDot = true;
}
- else if (!CTYPE(isdigit, (int)*p))
+ else if (!isdigit((unsigned char) *p))
break;
if (*p) {
warn("bad '%c' character in %s field on line %d", *p, name, line);
@@ -202,7 +202,7 @@
else
p = buff + strlen(buff);
while (--p >= buff) {
- if (isspace((int)*p))
+ if (isspace((unsigned char) *p))
*p = '\0';
else
break;
Modified: expire/fastrm.c
===================================================================
--- expire/fastrm.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ expire/fastrm.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -666,7 +666,7 @@
continue;
case 'c':
chdir_threshold = 1;
- if (!CTYPE(isdigit, p[1]))
+ if (!isdigit((unsigned char) p[1]))
continue;
chdir_threshold = atoi(p + 1);
break;
@@ -678,13 +678,13 @@
continue;
case 's':
sort_threshold = 5;
- if (!CTYPE(isdigit, p[1]))
+ if (!isdigit((unsigned char) p[1]))
continue;
sort_threshold = atoi(p + 1);
break;
case 'u':
relative_threshold = 1;
- if (!CTYPE(isdigit, p[1]))
+ if (!isdigit((unsigned char) p[1]))
continue;
relative_threshold = atoi(p + 1);
if (relative_threshold >= (int) strlen(dotdots) / 3)
Modified: frontends/ctlinnd.c
===================================================================
--- frontends/ctlinnd.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ frontends/ctlinnd.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -320,7 +320,7 @@
if (reply) {
/* Skip "<exitcode><space>" part of reply. */
- for (p = reply; *p && CTYPE(isdigit, *p); p++)
+ for (p = reply; *p && isdigit((unsigned char) *p); p++)
continue;
while (*p && ISWHITE(*p))
p++;
Modified: frontends/inews.c
===================================================================
--- frontends/inews.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ frontends/inews.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -179,7 +179,7 @@
for (start = p; ISWHITE(*start); start++)
continue;
- for (p = start + strlen(start); p > start && CTYPE(isspace, p[-1]); )
+ for (p = start + strlen(start); p > start && isspace((unsigned char) p[-1]); )
*--p = '\0';
return start;
}
@@ -238,7 +238,7 @@
}
/* See if it's a known header. */
- c = CTYPE(islower, *p) ? toupper(*p) : *p;
+ c = islower((unsigned char) *p) ? toupper(*p) : *p;
for (hp = Table; hp < ARRAY_END(Table); hp++)
if (c == hp->Name[0]
&& p[hp->Size] == ':'
@@ -455,8 +455,8 @@
for (out = outbuff; *p && !GECOSTERM(*p) && left; p++) {
if (*p == '&') {
strncpy(out, pwp->pw_name, left);
- if (CTYPE(islower, *out)
- && (out == outbuff || !CTYPE(isalpha, out[-1])))
+ if (islower((unsigned char) *out)
+ && (out == outbuff || !isalpha((unsigned char) out[-1])))
*out = toupper(*out);
while (*out) {
out++;
@@ -465,7 +465,7 @@
}
else if (*p == '-'
&& p > pwp->pw_gecos
- && (CTYPE(isdigit, p[-1]) || CTYPE(isspace, p[-1])
+ && (isdigit((unsigned char) p[-1]) || isspace((unsigned char) p[-1])
|| p[-1] == ']')) {
out = outbuff;
left = SMBUF - 1;
Modified: frontends/rnews.c
===================================================================
--- frontends/rnews.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ frontends/rnews.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -271,7 +271,7 @@
return false;
}
REMclean(buff);
- if (!CTYPE(isdigit, buff[0])) {
+ if (!isdigit((unsigned char) buff[0])) {
free(wirefmt);
notice("bad_reply after ihave %s", buff);
return false;
@@ -325,7 +325,7 @@
return false;
}
REMclean(buff);
- if (!CTYPE(isdigit, buff[0])) {
+ if (!isdigit((unsigned char) buff[0])) {
notice("bad_reply after article %s", buff);
return false;
}
Modified: frontends/sys2nf.c
===================================================================
--- frontends/sys2nf.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ frontends/sys2nf.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -87,7 +87,7 @@
break;
}
if (*p == '\\' && p[1] == '\n')
- while (*++p && CTYPE(isspace, *p))
+ while (*++p && isspace((unsigned char) *p))
continue;
else
*to++ = *p++;
Modified: include/clibrary.h
===================================================================
--- include/clibrary.h 2010-03-19 21:24:35 UTC (rev 9018)
+++ include/clibrary.h 2010-03-19 21:27:15 UTC (rev 9019)
@@ -35,25 +35,9 @@
prototypes isn't high enough to be worth the trouble. */
#include <stdio.h>
#include <sys/types.h>
-#if STDC_HEADERS
-# include <stdlib.h>
-# include <stddef.h>
-#else
-# if HAVE_STDLIB_H
-# include <stdlib.h>
-# endif
-# if !HAVE_STRCHR
-# define strchr index
-# define strrchr rindex
-# endif
-# if !HAVE_MEMCPY
-# define memcpy(d, s, n) bcopy((s), (d), (n))
-# endif
-#endif
+#include <stdlib.h>
+#include <stddef.h>
#if HAVE_STRING_H
-# if !STDC_HEADERS && HAVE_MEMORY_H
-# include <memory.h>
-# endif
# include <string.h>
#else
# if HAVE_STRINGS_H
@@ -173,18 +157,6 @@
# define STDERR_FILENO 2
#endif
-/* On some systems, the macros defined by <ctype.h> are only vaild on ASCII
- characters (those characters that isascii() says are ASCII). This comes
- into play when applying <ctype.h> macros to eight-bit data. autoconf
- checks for this with as part of AC_HEADER_STDC, so if autoconf doesn't
- think our headers are standard, check isascii() first. */
-#if STDC_HEADERS
-# define CTYPE(isXXXXX, c) (isXXXXX((unsigned char)(c)))
-#else
-# define CTYPE(isXXXXX, c) \
- (isascii((unsigned char)(c)) && isXXXXX((unsigned char)(c)))
-#endif
-
/* POSIX.1g requires <sys/un.h> to define a SUN_LEN macro for determining
the real length of a struct sockaddr_un, but it's not available
everywhere yet. If autoconf couldn't find it, define our own. This
Modified: innd/art.c
===================================================================
--- innd/art.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ innd/art.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -649,7 +649,7 @@
}
/* See if this is a system header. A fairly tightly-coded binary search. */
- c = CTYPE(islower, *header) ? toupper(*header) : *header;
+ c = islower((unsigned char) *header) ? toupper(*header) : *header;
for (*colon = '\0', tp = ARTheadertree; tp; ) {
if ((i = c - tp->Name[0]) == 0 && (i = strcasecmp(header, tp->Name)) == 0)
break;
@@ -2185,7 +2185,7 @@
/* Nip off the first word into lowercase. */
strlcpy(ControlWord, HDR(HDR__CONTROL), sizeof(ControlWord));
for (p = ControlWord; *p && !ISWHITE(*p); p++)
- if (CTYPE(isupper, *p))
+ if (isupper((unsigned char) *p))
*p = tolower(*p);
*p = '\0';
LikeNewgroup = (strcasecmp(ControlWord, "newgroup") == 0
Modified: innd/cc.c
===================================================================
--- innd/cc.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ innd/cc.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -407,7 +407,7 @@
Rest = av[1];
if (Rest[0] != NF_FLAG_ALIAS) {
Rest[1] = '\0';
- if (CTYPE(isupper, Rest[0]))
+ if (isupper((unsigned char) Rest[0]))
Rest[0] = tolower(Rest[0]);
}
return CCdochange(ngp, Rest);
@@ -709,7 +709,7 @@
/* Parse the argument, a channel number. */
for (p = av[0], fd = 0; *p; p++) {
- if (!CTYPE(isdigit, *p))
+ if (!isdigit((unsigned char) *p))
return "1 Bad channel number";
fd = fd * 10 + *p - '0';
}
@@ -998,7 +998,7 @@
Rest = av[1];
if (Rest[0] != NF_FLAG_ALIAS) {
Rest[1] = '\0';
- if (CTYPE(isupper, Rest[0]))
+ if (isupper((unsigned char) Rest[0]))
Rest[0] = tolower(Rest[0]);
}
@@ -1622,7 +1622,7 @@
value = 0;
else {
for (p = av[0]; *p; p++) {
- if (!CTYPE(isdigit, *p))
+ if (!isdigit((unsigned char) *p))
return "1 parameter should be a number or 'off'";
}
value = strtoul(av[0], NULL, 10);
@@ -1661,7 +1661,7 @@
value = 0;
else {
for (p = av[0]; *p; p++) {
- if (!CTYPE(isdigit, *p))
+ if (!isdigit((unsigned char) *p))
return "1 parameter should be a number or 'off'";
}
value = strtoul(av[0], NULL, 10);
Modified: innd/keywords.c
===================================================================
--- innd/keywords.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ innd/keywords.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -152,7 +152,7 @@
/* Abusive punctuation stripping: turn it all into spaces. */
for (punc = text; *punc; punc++)
- if (!CTYPE(isalpha, *punc))
+ if (!isalpha((unsigned char) *punc))
*punc = ' ';
/* Move to first word. */
@@ -184,7 +184,7 @@
/* Squash to lowercase. */
for (chase = this_word; *chase; chase++)
- if (CTYPE(isupper, *chase))
+ if (isupper((unsigned char) *chase))
*chase = tolower(*chase);
}
Modified: innd/newsfeeds.c
===================================================================
--- innd/newsfeeds.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ innd/newsfeeds.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -57,7 +57,7 @@
if (*line != VARIABLE_CHAR)
return false;
- for (p = line + 1; *p != '\0' && CTYPE(isalnum, *p); p++)
+ for (p = line + 1; *p != '\0' && isalnum((unsigned char) *p); p++)
;
if (*p != '=')
return false;
@@ -151,7 +151,7 @@
for (p = site; p <= site + strlen(site); p++) {
/* In variable name. */
if (*varname) {
- if (CTYPE(isalnum, *p)) {
+ if (isalnum((unsigned char) *p)) {
if (q - varname > 32) {
/* Add ignored modifier. */
if (modifier)
@@ -212,7 +212,7 @@
for (p = site; p <= site + strlen(site); p++) {
/* In variable name. */
if (*varname) {
- if (CTYPE(isalnum, *p)) {
+ if (isalnum((unsigned char) *p)) {
if (q - varname > 32) {
if (modifier)
*s++ = modifier;
@@ -321,7 +321,7 @@
break;
}
if (*p == '\\' && p[1] == '\n')
- while (*++p && CTYPE(isspace, *p))
+ while (*++p && isspace((unsigned char) *p))
continue;
else
*to++ = *p++;
@@ -520,11 +520,11 @@
case '\0':
break;
case '<':
- if (*++p && CTYPE(isdigit, *p))
+ if (*++p && isdigit((unsigned char) *p))
sp->MaxSize = atol(p);
break;
case '>':
- if (*++p && CTYPE(isdigit, *p))
+ if (*++p && isdigit((unsigned char) *p))
sp->MinSize = atol(p);
break;
case 'A':
@@ -548,16 +548,16 @@
}
break;
case 'B':
- if (*++p && CTYPE(isdigit, *p)) {
+ if (*++p && isdigit((unsigned char) *p)) {
sp->StartWriting = atoi(p);
if ((p = strchr(p, NF_SUBFIELD_SEP)) != NULL
&& *++p
- && CTYPE(isdigit, *p))
+ && isdigit((unsigned char) *p))
sp->StopWriting = atoi(p);
}
break;
case 'C':
- if (*++p && CTYPE(isdigit, *p))
+ if (*++p && isdigit((unsigned char) *p))
sp->Crosscount = atoi(p);
else
sp->Crosscount = 2;
@@ -569,19 +569,19 @@
sp->SpoolName = concatpath(innconf->pathoutgoing, p);
break;
case 'G':
- if (*++p && CTYPE(isdigit, *p))
+ if (*++p && isdigit((unsigned char) *p))
sp->Groupcount = atoi(p);
else
sp->Groupcount = 1;
break;
case 'H':
- if (*++p && CTYPE(isdigit, *p))
+ if (*++p && isdigit((unsigned char) *p))
sp->Hops = atoi(p);
else
sp->Hops = 1;
break;
case 'I':
- if (*++p && CTYPE(isdigit, *p))
+ if (*++p && isdigit((unsigned char) *p))
sp->Flushpoint = strtoul(p, NULL, 10);
break;
case 'N':
@@ -599,7 +599,7 @@
sp->Originator = SlashSplit(p);
break;
case 'P':
- if (*++p && CTYPE(isdigit, *p))
+ if (*++p && isdigit((unsigned char) *p))
sp->Nice = atoi(p);
break;
case 'Q':
@@ -636,7 +636,7 @@
sp->HashFeedList = hf;
break;
case 'S':
- if (*++p && CTYPE(isdigit, *p))
+ if (*++p && isdigit((unsigned char) *p))
sp->StartSpooling = atol(p);
break;
case 'T':
@@ -652,7 +652,7 @@
}
break;
case 'U':
- if (*++p && CTYPE(isdigit, *p))
+ if (*++p && isdigit((unsigned char) *p))
sp->Followcount = atoi(p);
else
sp->Followcount = 1;
@@ -747,7 +747,7 @@
if (f3 != NULL)
return "bad (extra) sprintf format for field 4";
f3 = p;
- while (*++p && *p != '*' && !CTYPE(isalpha, *p))
+ while (*++p && *p != '*' && !isalpha((unsigned char) *p))
continue;
if (*p != 's')
return "bad sprintf format for field 4";
Modified: innd/python.c
===================================================================
--- innd/python.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ innd/python.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -475,7 +475,7 @@
worksize = insize;
/* Chop leading whitespace. */
- for (p=instring ; worksize>0 && isspace(*p) ; p++) {
+ for (p=instring ; worksize>0 && isspace((unsigned char) *p) ; p++) {
if (*p == '\n')
lines--;
worksize--;
@@ -483,7 +483,7 @@
wpos = p;
/* And trailing. */
- for (p=&wpos[worksize] ; worksize>0 && isspace(*p) ; p--) {
+ for (p=&wpos[worksize] ; worksize>0 && isspace((unsigned char) *p) ; p--) {
if (*p == '\n')
lines--;
worksize--;
@@ -506,7 +506,7 @@
p = wpos;
q = workstring;
for (i=0 ; i<worksize ; i++) {
- if (isspace(*p)) {
+ if (isspace((unsigned char) *p)) {
if (!wasspace)
*q++ = ' ';
wasspace = 1;
Modified: innd/rc.c
===================================================================
--- innd/rc.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ innd/rc.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -1252,7 +1252,7 @@
break;
}
RCadddata(data, &infocount, K_MAX_CONN, T_STRING, word);
- for (p = word; CTYPE(isdigit, *p) && *p != '\0'; p++);
+ for (p = word; isdigit((unsigned char) *p) && *p != '\0'; p++);
if (!strcmp (word, "none") || !strcmp (word, "unlimited")) {
max = 0;
} else {
@@ -1285,7 +1285,7 @@
break;
}
RCadddata(data, &infocount, K_HOLD_TIME, T_STRING, word);
- for (p = word; CTYPE(isdigit, *p) && *p != '\0'; p++);
+ for (p = word; isdigit((unsigned char) *p) && *p != '\0'; p++);
if (*p != '\0') {
syslog(L_ERROR, MUST_BE_INT, LogName, filename, linecount);
break;
Modified: innfeed/configfile.y
===================================================================
--- innfeed/configfile.y 2010-03-19 21:24:35 UTC (rev 9018)
+++ innfeed/configfile.y 2010-03-19 21:27:15 UTC (rev 9019)
@@ -487,7 +487,7 @@
break ;
default:
- if (CTYPE (isprint, v->v.char_val))
+ if (isprint((unsigned char) v->v.char_val))
fprintf (fp,"%c",v->v.char_val) ;
else
fprintf (fp,"\\%03o",v->v.char_val) ;
@@ -587,7 +587,7 @@
return rval ;
}
- if (!CTYPE(isalpha, *p))
+ if (!isalpha((unsigned char) *p))
{
rval = xmalloc (strlen (NON_ALPHA) + strlen (key) + 15) ;
sprintf (rval,NON_ALPHA,lineCount, key) ;
@@ -597,7 +597,7 @@
p++ ;
while (*p)
{
- if (!(CTYPE (isalnum, *p) || *p == '_' || *p == '-'))
+ if (!(isalnum((unsigned char) *p) || *p == '_' || *p == '-'))
{
rval = xmalloc (strlen (BAD_KEY) + strlen (key) + 15) ;
sprintf (rval,BAD_KEY,lineCount,key) ;
Modified: innfeed/imap_connection.c
===================================================================
--- innfeed/imap_connection.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ innfeed/imap_connection.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -808,7 +808,7 @@
*start = str+headerlen+1;
/* get rid of leading whitespace */
- while ( isspace((int) **start))
+ while (isspace((unsigned char) **start))
(*start)++;
}
@@ -998,8 +998,8 @@
ASSERT(folder); ASSERT(msgid); ASSERT(cxn);
/* sanity check folder, msgid */
- for (i = 0; i < folderlen; i++) ASSERT(!isspace((int) folder[i]));
- for (i = 0; i < msgidlen; i++) ASSERT(!isspace((int) msgid[i]));
+ for (i = 0; i < folderlen; i++) ASSERT(!isspace((unsigned char) folder[i]));
+ for (i = 0; i < msgidlen; i++) ASSERT(!isspace((unsigned char) msgid[i]));
/* create the object */
item = xcalloc (1, sizeof(control_item_t));
@@ -1703,9 +1703,9 @@
if (strlen(str) < 3) return -1;
/* check to make sure 0-2 are digits */
- if ((isdigit((int) str[0])==0) ||
- (isdigit((int) str[1])==0) ||
- (isdigit((int) str[2])==0))
+ if ((!isdigit((unsigned char) str[0])) ||
+ (!isdigit((unsigned char) str[1])) ||
+ (!isdigit((unsigned char) str[2])))
{
d_printf(0,
"Parse error: response does not begin with a code [%s]\n",
Modified: innfeed/innlistener.c
===================================================================
--- innfeed/innlistener.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ innfeed/innlistener.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -526,7 +526,7 @@
/* See if this is a valid peername */
for(s = peer; *s; s++)
- if (!CTYPE(isalnum, *s) && *s != '.' && *s != '-' && *s != '_')
+ if (!isalnum((unsigned char) *s) && *s != '.' && *s != '-' && *s != '_')
break;
if (*s != 0) {
warn ("ME invalid peername %s", peer) ;
Modified: innfeed/misc.c
===================================================================
--- innfeed/misc.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ innfeed/misc.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -196,10 +196,10 @@
if (p == NULL)
return false ;
- while (*p && CTYPE (isspace, *p))
+ while (*p && isspace((unsigned char) *p))
p++ ;
- while (*p && CTYPE (isdigit, *p))
+ while (*p && isdigit((unsigned char) *p))
{
digits++ ;
cd = (cd * 10) + (*p - '0') ;
@@ -212,7 +212,7 @@
if (*p == '-')
p++ ;
- while (*p && CTYPE (isspace, *p))
+ while (*p && isspace((unsigned char) *p))
p++ ;
if (rest)
@@ -231,15 +231,15 @@
const char *q ;
char *rval ;
- while (*p && CTYPE (isspace, *p)) p++ ;
- while (*p && !CTYPE (isspace, *p)) p++ ; /* skip response code */
- while (*p && CTYPE (isspace, *p)) p++ ;
+ while (*p && isspace((unsigned char) *p)) p++ ;
+ while (*p && !isspace((unsigned char) *p)) p++ ; /* skip response code */
+ while (*p && isspace((unsigned char) *p)) p++ ;
if ( *p == '\0' )
return NULL ;
q = p ;
- while ( *q && !CTYPE (isspace, *q) )
+ while ( *q && !isspace((unsigned char) *q) )
q++ ;
rval = xstrndup (p, q - p) ;
@@ -254,12 +254,12 @@
{
char *p, *q ;
- for (p = ptr ; *p && CTYPE (isspace, *p) ; p++)
+ for (p = ptr ; *p && isspace((unsigned char) *p) ; p++)
/* nada */ ;
if ( ! *p )
return NULL ;
- for (q = p ; *q && !CTYPE (isspace, *q) ; q++)
+ for (q = p ; *q && !isspace((unsigned char) *q) ; q++)
/* nada */ ;
*tail = q ;
@@ -327,7 +327,7 @@
if (len == 0)
return ;
- for (p = string + len - 1 ; p >= string && CTYPE (isspace, *p) ; p--)
+ for (p = string + len - 1 ; p >= string && isspace((unsigned char) *p) ; p--)
/* nada */ ;
*++p = '\0' ;
}
Modified: innfeed/tape.c
===================================================================
--- innfeed/tape.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ innfeed/tape.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -734,7 +734,7 @@
{
msgid = filename = NULL ;
- for (p = line ; *p && CTYPE(isspace, *p) ; p++) /* eat whitespace */
+ for (p = line ; *p && isspace((unsigned char) *p) ; p++) /* eat whitespace */
/* nada */ ;
if (*p != '\0')
@@ -746,7 +746,7 @@
filename = p ;
*q = '\0' ;
- for (q++ ; *q && CTYPE(isspace, *q) ; q++)
+ for (q++ ; *q && isspace((unsigned char) *q) ; q++)
/* nada */ ;
if (*q != '\0')
Modified: lib/commands.c
===================================================================
--- lib/commands.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ lib/commands.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -27,11 +27,11 @@
return false;
/* Begins with a letter. */
- if (!CTYPE(isalpha, string[0]))
+ if (!isalpha((unsigned char) string[0]))
return false;
for (; *string != '\0'; string++) {
- if (CTYPE(isalnum, *string) || *string == '.' || *string == '-')
+ if (isalnum((unsigned char) *string) || *string == '.' || *string == '-')
len++;
else
return false;
Modified: lib/concat.c
===================================================================
--- lib/concat.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ lib/concat.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -29,9 +29,7 @@
#include "inn/libinn.h"
#include <stdarg.h>
-#if STDC_HEADERS
-# include <string.h>
-#endif
+#include <string.h>
/* Abbreviation for cleaner code. */
#define VA_NEXT(var, type) ((var) = (type) va_arg(args, type))
Modified: lib/date.c
===================================================================
--- lib/date.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ lib/date.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -362,10 +362,10 @@
if ((datelen != 6 && datelen != 8) || strlen(hour) != 6)
return (time_t) -1;
for (p = date; *p; p++)
- if (!CTYPE(isdigit, *p))
+ if (!isdigit((unsigned char) *p))
return (time_t) -1;
for (p = hour; *p; p++)
- if (!CTYPE(isdigit, *p))
+ if (!isdigit((unsigned char) *p))
return (time_t) -1;
/* Parse the date into a struct tm, skipping over the century part of
@@ -476,7 +476,7 @@
size_t i, size;
const char *end;
- for (end = p; *end != '\0' && CTYPE(isalpha, *end); end++)
+ for (end = p; *end != '\0' && isalpha((unsigned char) *end); end++)
;
if (*end == '.')
end++;
@@ -559,7 +559,7 @@
const char *end;
size_t max, i;
- for (end = p; *end != '\0' && CTYPE(isalpha, *end); end++)
+ for (end = p; *end != '\0' && isalpha((unsigned char) *end); end++)
;
if (end == p)
return NULL;
@@ -570,7 +570,7 @@
*offset = ZONE_OFFSET[i].offset;
return p;
}
- if (max == 1 && CTYPE(isalpha, *p) && *p != 'J' && *p != 'j') {
+ if (max == 1 && isalpha((unsigned char) *p) && *p != 'J' && *p != 'j') {
*offset = 0;
return p + 1;
}
@@ -635,7 +635,7 @@
/* Parse the base part of the date. The initial day of the week is
optional. */
p = skip_cfws(date);
- if (CTYPE(isalpha, *p))
+ if (isalpha((unsigned char) *p))
p = parse_by_rule(p, base_rule, ARRAY_SIZE(base_rule), values);
else
p = parse_by_rule(p, base_rule + 2, ARRAY_SIZE(base_rule) - 2,
@@ -745,7 +745,7 @@
/* Parse the base part of the date. The initial day of the week is
optional. Allow for anything that looks vaguely day-like. */
p = skip_cfws(date);
- while (*p != '\0' && !CTYPE(isdigit, *p) && *p != ',')
+ while (*p != '\0' && !isdigit((unsigned char) *p) && *p != ',')
p++;
if (*p == ',')
p = skip_cfws(p + 1);
Modified: lib/hash.c
===================================================================
--- lib/hash.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ lib/hash.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -70,7 +70,7 @@
cip = cipoint(MessageID, len);
if (cip != NULL) {
for (p = cip + 1; *p != '\0'; p++) {
- if (!CTYPE(islower, *p)) {
+ if (!islower((unsigned char) *p)) {
new = xstrdup(MessageID);
break;
}
Modified: lib/headers.c
===================================================================
--- lib/headers.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ lib/headers.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -34,7 +34,7 @@
for (; *p != '\0'; p++) {
/* Contains only printable US-ASCII characters other
* than colon. */
- if (!CTYPE(isgraph, *p) || *p == ':')
+ if (!isgraph((unsigned char) *p) || *p == ':')
return false;
}
Modified: lib/inndcomm.c
===================================================================
--- lib/inndcomm.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ lib/inndcomm.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -396,8 +396,8 @@
/* Parse the rest of the reply; expected to be like
<exitcode><space><text>" */
i = 0;
- if (CTYPE(isdigit, buff[0])) {
- for (p = buff; *p && CTYPE(isdigit, *p); p++)
+ if (isdigit((unsigned char) buff[0])) {
+ for (p = buff; *p && isdigit((unsigned char) *p); p++)
continue;
if (*p) {
save = *p;
Modified: lib/nntp.c
===================================================================
--- lib/nntp.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ lib/nntp.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -220,7 +220,7 @@
*code = strtol(line, rest, 10);
if (*rest != line + 3)
*code = 0;
- else if (CTYPE(isspace, *rest[0]))
+ else if (isspace((unsigned char) *rest[0]))
(*rest)++;
return status;
}
Modified: lib/numbers.c
===================================================================
--- lib/numbers.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ lib/numbers.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -28,7 +28,7 @@
for (; *p != '\0'; p++) {
len++;
- if (!CTYPE(isdigit, *p))
+ if (!isdigit((unsigned char) *p))
return false;
}
Modified: m4/sendfd.m4
===================================================================
--- m4/sendfd.m4 2010-03-19 21:24:35 UTC (rev 9018)
+++ m4/sendfd.m4 2010-03-19 21:27:15 UTC (rev 9019)
@@ -10,7 +10,7 @@
define([_INN_SYS_STREAMS_SENDFD],
[AC_LANG_SOURCE([[
#include <stdio.h>
-#if STDC_HEADERS || HAVE_STRING_H
+#if HAVE_STRING_H
# include <string.h>
#endif
#include <stropts.h>
Modified: nnrpd/article.c
===================================================================
--- nnrpd/article.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ nnrpd/article.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -568,7 +568,7 @@
} else if (xrefheader && (VirtualPathlen > 0)) {
if ((r = memchr(p, ' ', q - p)) == NULL)
return NULL;
- for (; (r < q) && isspace((int)*r) ; r++);
+ for (; (r < q) && isspace((unsigned char) *r) ; r++);
if (r == q)
return NULL;
/* Copy the virtual path without its final '!'. */
@@ -621,7 +621,7 @@
/* It is better to check for a number before a message-ID because
* '<' could have been forgotten and the error message should then
* report a syntax error in the message-ID. */
- if (CTYPE(isdigit, av[1][0])) {
+ if (isdigit((unsigned char) av[1][0])) {
Reply("%d Syntax error in article number\r\n", NNTP_ERR_SYNTAX);
return;
} else if (!mid) {
@@ -925,7 +925,7 @@
/* It is better to check for a range before a message-ID because
* '<' could have been forgotten and the error message should then
* report a syntax error in the message-ID. */
- if (xover || CTYPE(isdigit, av[1][0]) || av[1][0] == '-') {
+ if (xover || isdigit((unsigned char) av[1][0]) || av[1][0] == '-') {
Reply("%d Syntax error in range\r\n", NNTP_ERR_SYNTAX);
return;
} else if (!mid) {
@@ -1137,7 +1137,7 @@
/* It is better to check for a range before a message-ID because
* '<' could have been forgotten and the error message should then
* report a syntax error in the message-ID. */
- if (CTYPE(isdigit, av[2][0]) || av[2][0] == '-') {
+ if (isdigit((unsigned char) av[2][0]) || av[2][0] == '-') {
Reply("%d Syntax error in range\r\n", NNTP_ERR_SYNTAX);
return;
} else if (!mid) {
Modified: nnrpd/nnrpd.c
===================================================================
--- nnrpd/nnrpd.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ nnrpd/nnrpd.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -517,7 +517,7 @@
/* Lowercase the returned name since wildmats are case-sensitive. */
if (valid) {
for (p = hostname; *p != '\0'; p++)
- if (CTYPE(isupper, *p))
+ if (isupper((unsigned char) *p))
*p = tolower((int) *p);
return true;
} else {
Modified: nnrpd/perm.c
===================================================================
--- nnrpd/perm.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ nnrpd/perm.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -677,7 +677,7 @@
* therefore also downcase the wildmat patterns to make sure there
* aren't any surprises. DNS is case-insensitive. */
for (p = curauth->hosts; *p; p++)
- if (CTYPE(isupper, (unsigned char) *p))
+ if (isupper((unsigned char) *p))
*p = tolower((unsigned char) *p);
break;
Modified: nnrpd/post.c
===================================================================
--- nnrpd/post.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ nnrpd/post.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -155,7 +155,7 @@
for (start = p; ISWHITE(*start) || *start == '\n'; start++)
continue;
- for (p = start + strlen(start); p > start && CTYPE(isspace, (int)p[-1]); p--)
+ for (p = start + strlen(start); p > start && isspace((unsigned char) p[-1]); p--)
continue;
return (int)(p - start);
}
@@ -194,7 +194,7 @@
for (p = article; ; ) {
/* See if it's a known header. */
- c = CTYPE(islower, (int)*p) ? toupper(*p) : *p;
+ c = islower((unsigned char) *p) ? toupper(*p) : *p;
for (hp = Table; hp < ARRAY_END(Table); hp++) {
if (c == hp->Name[0]
&& p[hp->Size] == ':'
Modified: nnrpd/sasl.c
===================================================================
--- nnrpd/sasl.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ nnrpd/sasl.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -56,7 +56,7 @@
for (; *p != '\0'; p++) {
len++;
- if (!CTYPE(isalnum, *p) && *p != '-' && *p != '_')
+ if (!isalnum((unsigned char) *p) && *p != '-' && *p != '_')
return false;
}
Modified: storage/buffindexed/buffindexed.c
===================================================================
--- storage/buffindexed/buffindexed.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ storage/buffindexed/buffindexed.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -430,7 +430,7 @@
while (1) {
if (*from && *from == '\\' && *(from + 1) == '\n') {
from += 2; /* Skip past backslash+newline */
- while (*from && isspace((int)*from))
+ while (*from && isspace((unsigned char) *from))
from++;
continue;
}
@@ -517,7 +517,7 @@
break;
}
n += (*hex - diff);
- if (isalnum((int)*(hex + 1)))
+ if (isalnum((unsigned char) *(hex + 1)))
n <<= 4;
}
return n;
@@ -2374,7 +2374,7 @@
}
fprintf(stdout, "GROUPheader->freelist.recno is %d(0x%08x)\n", GROUPheader->freelist.recno, GROUPheader->freelist.recno);
group = argv[1];
- if (CTYPE(isdigit, *group)) {
+ if (isdigit((unsigned char) *group)) {
gloc.recno = atoi(group);
ge = &GROUPentries[gloc.recno];
fprintf(stdout, "left articles are %d for %d, last expiry is %ld\n", ge->count, gloc.recno, (long) ge->expired);
Modified: storage/cnfs/cnfs.c
===================================================================
--- storage/cnfs/cnfs.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ storage/cnfs/cnfs.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -205,7 +205,7 @@
break;
}
n += (*hex - diff);
- if (isalnum((int)*(hex + 1)))
+ if (isalnum((unsigned char) *(hex + 1)))
n <<= 4;
}
return n;
@@ -809,7 +809,7 @@
while (1) {
if (*from && *from == '\\' && *(from + 1) == '\n') {
from += 2; /* Skip past backslash+newline */
- while (*from && isspace((int)*from))
+ while (*from && isspace((unsigned char) *from))
from++;
continue;
}
Modified: storage/expire.c
===================================================================
--- storage/expire.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ storage/expire.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -284,7 +284,7 @@
break;
SawDot = true;
}
- else if (!CTYPE(isdigit, (int)*p))
+ else if (!isdigit((unsigned char) *p))
break;
if (*p) {
fprintf(stderr, "Line %d, bad `%c' character in %s field\n",
@@ -358,7 +358,7 @@
else
p = buff + strlen(buff);
while (--p >= buff) {
- if (isspace((int)*p))
+ if (isspace((unsigned char) *p))
*p = '\0';
else
break;
Modified: storage/interface.c
===================================================================
--- storage/interface.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ storage/interface.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -54,7 +54,7 @@
return false;
for (p = text + 1; *p != '@'; p++)
- if (!isxdigit((int)*p))
+ if (!isxdigit((unsigned char) *p))
return false;
return true;
@@ -90,7 +90,7 @@
** Converts a hex digit and converts it to a int
*/
static int hextodec(const int c) {
- return isdigit(c) ? (c - '0') : ((c - 'A') + 10);
+ return isdigit((unsigned char) c) ? (c - '0') : ((c - 'A') + 10);
}
/*
@@ -195,7 +195,7 @@
ret = 0;
startnum = tmbuf;
while (*tmbuf) {
- if (!isdigit((int)*tmbuf)) {
+ if (!isdigit((unsigned char) *tmbuf)) {
tmp = atol(startnum);
switch (*tmbuf) {
case 'M':
Modified: storage/ov.c
===================================================================
--- storage/ov.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ storage/ov.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -184,7 +184,7 @@
memcpy(patcheck, next, xreflen);
patcheck[xreflen] = '\0';
for (group = patcheck; group && *group; group = memchr(nextcheck, ' ', xreflen - (nextcheck - patcheck))) {
- while (isspace((int)*group))
+ while (isspace((unsigned char) *group))
group++;
if ((nextcheck = memchr(group, ':', xreflen - (group - patcheck))) == NULL)
return OVADDFAILED;
@@ -207,7 +207,7 @@
xrefdata[xreflen] = '\0';
for (group = xrefdata; group && *group; group = memchr(next, ' ', xreflen - (next - xrefdata))) {
/* Parse the Xref: part into group name and article number. */
- while (isspace((int)*group))
+ while (isspace((unsigned char) *group))
group++;
if ((next = memchr(group, ':', xreflen - (group - xrefdata))) == NULL)
return OVADDFAILED;
Modified: storage/overdata.c
===================================================================
--- storage/overdata.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ storage/overdata.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -200,7 +200,7 @@
const char *p;
for (p = string; *p != '\0'; p++)
- if (!CTYPE(isdigit, *p))
+ if (!isdigit((unsigned char) *p))
return false;
return true;
}
@@ -225,7 +225,7 @@
if (*p == '\0' || (*p == '\r' && p[1] == '\n' && p[2] == '\0'))
return true;
for (; *p != '\0' && *p != ':'; p++)
- if (!CTYPE(isgraph, *p))
+ if (!isgraph((unsigned char) *p))
return false;
if (*p != ':')
return false;
Modified: storage/timecaf/timecaf.c
===================================================================
--- storage/timecaf/timecaf.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ storage/timecaf/timecaf.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -712,22 +712,22 @@
if (type == FIND_TOPDIR)
if ((strlen(de->d_name) == 10) &&
(strncmp(de->d_name, "timecaf-", 8) == 0) &&
- CTYPE(isxdigit, de->d_name[8]) &&
- CTYPE(isxdigit, de->d_name[9]))
+ isxdigit((unsigned char) de->d_name[8]) &&
+ isxdigit((unsigned char) de->d_name[9]))
return de;
if (type == FIND_DIR)
if ((strlen(de->d_name) == 2)
- && CTYPE(isxdigit, de->d_name[0])
- && CTYPE(isxdigit, de->d_name[1]))
+ && isxdigit((unsigned char) de->d_name[0])
+ && isxdigit((unsigned char) de->d_name[1]))
return de;
if (type == FIND_CAF)
if ((strlen(de->d_name) == 7) &&
- CTYPE(isxdigit, de->d_name[0]) &&
- CTYPE(isxdigit, de->d_name[1]) &&
- CTYPE(isxdigit, de->d_name[2]) &&
- CTYPE(isxdigit, de->d_name[3]) &&
+ isxdigit((unsigned char) de->d_name[0]) &&
+ isxdigit((unsigned char) de->d_name[1]) &&
+ isxdigit((unsigned char) de->d_name[2]) &&
+ isxdigit((unsigned char) de->d_name[3]) &&
(de->d_name[4] == '.') &&
(de->d_name[5] == 'C') &&
(de->d_name[6] == 'F'))
Modified: storage/timehash/timehash.c
===================================================================
--- storage/timehash/timehash.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ storage/timehash/timehash.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -397,24 +397,26 @@
if (type == FIND_TOPDIR)
if ((strlen(de->d_name) == 7) &&
(strncmp(de->d_name, "time-", 5) == 0) &&
- isxdigit((int)de->d_name[5]) &&
- isxdigit((int)de->d_name[6]))
+ isxdigit((unsigned char) de->d_name[5]) &&
+ isxdigit((unsigned char) de->d_name[6]))
return de;
if (type == FIND_DIR)
- if ((strlen(de->d_name) == 2) && isxdigit((int)de->d_name[0]) && isxdigit((int)de->d_name[1]))
+ if ((strlen(de->d_name) == 2)
+ && isxdigit((unsigned char) de->d_name[0])
+ && isxdigit((unsigned char) de->d_name[1]))
return de;
if (type == FIND_ART)
if ((strlen(de->d_name) == 9) &&
- isxdigit((int)de->d_name[0]) &&
- isxdigit((int)de->d_name[1]) &&
- isxdigit((int)de->d_name[2]) &&
- isxdigit((int)de->d_name[3]) &&
- isxdigit((int)de->d_name[5]) &&
- isxdigit((int)de->d_name[6]) &&
- isxdigit((int)de->d_name[7]) &&
- isxdigit((int)de->d_name[8]) &&
+ isxdigit((unsigned char) de->d_name[0]) &&
+ isxdigit((unsigned char) de->d_name[1]) &&
+ isxdigit((unsigned char) de->d_name[2]) &&
+ isxdigit((unsigned char) de->d_name[3]) &&
+ isxdigit((unsigned char) de->d_name[5]) &&
+ isxdigit((unsigned char) de->d_name[6]) &&
+ isxdigit((unsigned char) de->d_name[7]) &&
+ isxdigit((unsigned char) de->d_name[8]) &&
(de->d_name[4] == '-'))
return de;
}
Modified: storage/tradindexed/tdx-util.c
===================================================================
--- storage/tradindexed/tdx-util.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ storage/tradindexed/tdx-util.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -171,7 +171,7 @@
const char *p;
for (p = string; *p != '\0'; p++)
- if (!CTYPE(isdigit, *p))
+ if (!isdigit((unsigned char) *p))
return false;
return true;
}
Modified: storage/tradspool/tradspool.c
===================================================================
--- storage/tradspool/tradspool.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ storage/tradspool/tradspool.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -1050,7 +1050,7 @@
while ((de = readdir(dir)) != NULL) {
namelen = strlen(de->d_name);
for (i = 0, flag = true ; i < namelen ; ++i) {
- if (!CTYPE(isdigit, de->d_name[i])) {
+ if (!isdigit((unsigned char) de->d_name[i])) {
flag = false;
break;
}
Modified: tests/lib/xmalloc.c
===================================================================
--- tests/lib/xmalloc.c 2010-03-19 21:24:35 UTC (rev 9018)
+++ tests/lib/xmalloc.c 2010-03-19 21:27:15 UTC (rev 9019)
@@ -246,7 +246,7 @@
/* If the code is capitalized, install our customized error handler. */
code = argv[1][0];
- if (isupper(code)) {
+ if (isupper((unsigned char) code)) {
xmalloc_error_handler = test_handler;
code = tolower(code);
}
More information about the inn-committers
mailing list