|
Neohapsis is currently accepting applications for employment. For more information, please visit our website www.neohapsis.com or email hr@neohapsis.com |
[Patch:] ap_isdigit -> isdigit in httpd. Revision #2 with cast (unsigned char) included.
From: Daniel Ouellet (daniel
presscom.net)
Date: Fri Mar 31 2006 - 22:45:03 CST
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Full review of the httpd files reveal that none of the value pass to
ap_isdigit where of (unsigned char) type. So, as such proper cast was
added in the replacement as well. This keep the same results as the use
of ap_isdigit API, but convert to the native isdigit() macro and avoid
the dual previous step and hopefully you would see this as more code
cleanup as well.
Thanks for your time.
Daniel
++++++++++++++++++++++++++
Index: src/main/http_protocol.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/main/http_protocol.c,v
retrieving revision 1.30
diff -u -r1.30 http_protocol.c
--- src/main/http_protocol.c 11 Feb 2006 19:15:57 -0000 1.30
+++ src/main/http_protocol.c 1 Apr 2006 04:12:52 -0000

-154,7 +154,7 
return BYTERANGE_EMPTY;
}
- if (ap_isdigit(*r->range))
+ if (isdigit((unsigned char)*r->range))
*start = ap_strtol(r->range, (char **)&r->range, 10);
else
*start = -1;

-169,7 +169,7 
while (ap_isspace(*r->range))
++r->range;
- if (ap_isdigit(*r->range))
+ if (isdigit((unsigned char)*r->range))
*end = ap_strtol(r->range, (char **)&r->range, 10);
else
*end = -1;

-1012,8 +1012,8 
if (strlen(r->protocol) == 8
&& r->protocol[0] == 'H' && r->protocol[1] == 'T'
&& r->protocol[2] == 'T' && r->protocol[3] == 'P'
- && r->protocol[4] == '/' && ap_isdigit(r->protocol[5])
- && r->protocol[6] == '.' && ap_isdigit(r->protocol[7])) {
+ && r->protocol[4] == '/' && isdigit((unsigned char)r->protocol[5])
+ && r->protocol[6] == '.' && isdigit((unsigned char)r->protocol[7])) {
r->proto_num = HTTP_VERSION(r->protocol[5] - '0',
r->protocol[7] - '0');
}
else {

-2768,9 +2768,9 
*/
if (r->status_line != NULL
&& strlen(r->status_line) > 4 /* long enough */
- && ap_isdigit(r->status_line[0])
- && ap_isdigit(r->status_line[1])
- && ap_isdigit(r->status_line[2])
+ && isdigit((unsigned char)r->status_line[0])
+ && isdigit((unsigned char)r->status_line[1])
+ && isdigit((unsigned char)r->status_line[2])
&& ap_isspace(r->status_line[3])
&& ap_isalnum(r->status_line[4])) {
title = r->status_line;
Index: src/main/http_vhost.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/main/http_vhost.c,v
retrieving revision 1.7
diff -u -r1.7 http_vhost.c
--- src/main/http_vhost.c 21 Aug 2003 13:11:35 -0000 1.7
+++ src/main/http_vhost.c 1 Apr 2006 04:12:53 -0000

-724,7 +724,7 
if (*src == ':') {
/* check the port part */
while (*++src) {
- if (!ap_isdigit(*src)) {
+ if (!isdigit((unsigned char)*src)) {
goto bad;
}
}
Index: src/main/util.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/main/util.c,v
retrieving revision 1.19
diff -u -r1.19 util.c
--- src/main/util.c 20 Jan 2006 00:21:43 -0000 1.19
+++ src/main/util.c 1 Apr 2006 04:12:53 -0000

-389,7 +389,7 
while ((c = *src++) != '\0') {
if (c == '&')
no = 0;
- else if (c == '$' && ap_isdigit(*src))
+ else if (c == '$' && isdigit((unsigned char)*src))
no = *src++ - '0';
else
no = 10;

-414,7 +414,7 
while ((c = *src++) != '\0') {
if (c == '&')
no = 0;
- else if (c == '$' && ap_isdigit(*src))
+ else if (c == '$' && isdigit((unsigned char)*src))
no = *src++ - '0';
else
no = 10;

-1771,7 +1771,7 
for (x = 0; u[x] != ':'; x++) {
if ((!u[x]) ||
- ((!ap_isalpha(u[x])) && (!ap_isdigit(u[x])) &&
+ ((!ap_isalpha(u[x])) && (!isdigit((unsigned char)u[x])) &&
(u[x] != '+') && (u[x] != '-') && (u[x] != '.'))) {
return 0;
}
Index: src/main/util_date.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/main/util_date.c,v
retrieving revision 1.6
diff -u -r1.6 util_date.c
--- src/main/util_date.c 21 Aug 2003 13:11:35 -0000 1.6
+++ src/main/util_date.c 1 Apr 2006 04:12:53 -0000

-106,7 +106,7 
return 0;
break;
case '#':
- if (!ap_isdigit(d))
+ if (!isdigit((unsigned char)d))
return 0;
break;
case '&':

-114,7 +114,7 
return 0;
break;
case '~':
- if ((d != ' ') && !ap_isdigit(d))
+ if ((d != ' ') && !isdigit((unsigned char)d))
return 0;
break;
default:
Index: src/main/util_script.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/main/util_script.c,v
retrieving revision 1.15
diff -u -r1.15 util_script.c
--- src/main/util_script.c 9 Feb 2005 12:13:10 -0000 1.15
+++ src/main/util_script.c 1 Apr 2006 04:12:53 -0000

-169,7 +169,7 
}
env[j] = ap_pstrcat(p, elts[i].key, "=", elts[i].val, NULL);
whack = env[j];
- if (ap_isdigit(*whack)) {
+ if (isdigit((unsigned char)*whack)) {
*whack++ = '_';
}
while (*whack != '=') {
Index: src/modules/extra/mod_define.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/extra/mod_define.c,v
retrieving revision 1.3
diff -u -r1.3 mod_define.c
--- src/modules/extra/mod_define.c 9 Feb 2005 12:13:10 -0000 1.3
+++ src/modules/extra/mod_define.c 1 Apr 2006 04:12:54 -0000

-128,7 +128,7 
cc = CC_BRACECLOSE;
else if (ap_isalpha(*cp))
cc = CC_IDCHAR1;
- else if (ap_isdigit(*cp) || *cp == '_' || *cp == ':')
+ else if (isdigit((unsigned char)*cp) || *cp == '_' || *cp == ':')
cc = CC_IDCHAR;
else if (*cp == '\0')
cc = CC_EOS;
Index: src/modules/proxy/mod_proxy.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/proxy/mod_proxy.c,v
retrieving revision 1.14
diff -u -r1.14 mod_proxy.c
--- src/modules/proxy/mod_proxy.c 9 Feb 2005 12:13:10 -0000 1.14
+++ src/modules/proxy/mod_proxy.c 1 Apr 2006 04:12:54 -0000

-668,7 +668,7 
ap_get_module_config(s->module_config, &proxy_module);
int *New;
- if (!ap_isdigit(arg[0]))
+ if (!isdigit((unsigned char)arg[0]))
return "AllowCONNECT: port number must be numeric";
New = ap_push_array(conf->allowed_connect_ports);
Index: src/modules/proxy/proxy_ftp.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/proxy/proxy_ftp.c,v
retrieving revision 1.14
diff -u -r1.14 proxy_ftp.c
--- src/modules/proxy/proxy_ftp.c 9 Feb 2005 12:13:10 -0000 1.14
+++ src/modules/proxy/proxy_ftp.c 1 Apr 2006 04:12:55 -0000

-194,8 +194,10 
if (len == -1)
return -1;
/* check format */
- if (len < 5 || !ap_isdigit(linebuff[0]) || !ap_isdigit(linebuff[1]) ||
- !ap_isdigit(linebuff[2]) || (linebuff[3] != ' ' && linebuff[3] !=
'-'))
+ if (len < 5 || !isdigit((unsigned char)linebuff[0]) ||
+ !isdigit((unsigned char)linebuff[1]) ||
+ !isdigit((unsigned char)linebuff[2]) ||
+ (linebuff[3] != ' ' && linebuff[3] != '-'))
status = 0;
else
status = 100 * linebuff[0] + 10 * linebuff[1] + linebuff[2] -
111 * '0';

-234,8 +236,10 
len = ap_bgets(linebuff, sizeof linebuff, ctrl);
if (len == -1)
return -1;
- if (len < 5 || !ap_isdigit(linebuff[0]) || !ap_isdigit(linebuff[1]) ||
- !ap_isdigit(linebuff[2]) || (linebuff[3] != ' ' && linebuff[3] !=
'-'))
+ if (len < 5 || !isdigit((unsigned char)linebuff[0]) ||
+ !isdigit((unsigned char)linebuff[1]) ||
+ !isdigit((unsigned char)linebuff[2]) ||
+ (linebuff[3] != ' ' && linebuff[3] != '-'))
status = 0;
else
status = 100 * linebuff[0] + 10 * linebuff[1] + linebuff[2] -
111 * '0';

-389,8 +393,9 
n = strlen(buf);
}
/* Handle unix style or DOS style directory */
- else if (buf[0] == 'd' || buf[0] == '-' || buf[0] == 'l' ||
ap_isdigit(buf[0])) {
- if (ap_isdigit(buf[0])) { /* handle DOS dir */
+ else if (buf[0] == 'd' || buf[0] == '-' || buf[0] == 'l' ||
+ isdigit((unsigned char)buf[0])) {
+ if (isdigit((unsigned char)buf[0])) { /* handle DOS dir */
searchptr = strchr(buf, '<');
if (searchptr != NULL)
*searchptr = '[';

-617,7 +622,7 
strp2 = strchr(desthost, ':');
if (strp2 != NULL) {
*(strp2++) = '\0';
- if (ap_isdigit(*strp2)) {
+ if (isdigit((unsigned char)*strp2)) {
destport = atoi(strp2);
destportstr = strp2;
}

-1087,7 +1092,7 
len = 0;
}
else if (i == 213) {/* Size command ok */
- for (j = 0; j < sizeof resp && ap_isdigit(resp[j]); j++);
+ for (j = 0; j < sizeof resp && isdigit((unsigned
char)resp[j]); j++);
resp[j] = '\0';
if (resp[0] != '\0')
size = ap_pstrdup(p, resp);
Index: src/modules/proxy/proxy_http.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/proxy/proxy_http.c,v
retrieving revision 1.16
diff -u -r1.16 proxy_http.c
--- src/modules/proxy/proxy_http.c 9 Feb 2005 12:13:10 -0000 1.16
+++ src/modules/proxy/proxy_http.c 1 Apr 2006 04:12:55 -0000

-212,7 +212,7 
strp2 = strchr(desthost, ':');
if (strp2 != NULL) {
*(strp2++) = '\0';
- if (ap_isdigit(*strp2)) {
+ if (isdigit((unsigned char)*strp2)) {
destport = atoi(strp2);
destportstr = strp2;
}
Index: 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 -r1.15 proxy_util.c
--- src/modules/proxy/proxy_util.c 9 Feb 2005 12:13:10 -0000 1.15
+++ src/modules/proxy/proxy_util.c 1 Apr 2006 04:12:56 -0000

-77,7 +77,7 
int ch;
ch = x[0];
- if (ap_isdigit(ch))
+ if (isdigit((unsigned char)ch))
i = ch - '0';
else if (ap_isupper(ch))
i = ch - ('A' - 10);

-86,7 +86,7 
i <<= 4;
ch = x[1];
- if (ap_isdigit(ch))
+ if (isdigit((unsigned char)ch))
i += ch - '0';
else if (ap_isupper(ch))
i += ch - ('A' - 10);

-249,7 +249,7 
*(strp++) = '\0';
for (i = 0; strp[i] != '\0'; i++)
- if (!ap_isdigit(strp[i]))
+ if (!isdigit((unsigned char)strp[i]))
break;
/* if (i == 0) the no port was given; keep default */

-267,7 +267,7 
return "Missing host in URL";
/* check hostname syntax */
for (i = 0; host[i] != '\0'; i++)
- if (!ap_isdigit(host[i]) && host[i] != '.')
+ if (!isdigit((unsigned char)host[i]) && host[i] != '.')
break;
/* must be an IP address */
if (host[i] == '\0' && (ap_inet_addr(host) == -1 ||
inet_network(host) == -1))

-805,7 +805,7 
for (i = 0, j = 0; i < 16; i++) {
ch = x[i];
j <<= 4;
- if (ap_isdigit(ch))
+ if (isdigit((unsigned char)ch))
j |= ch - '0';
else if (ap_isupper(ch))
j |= ch - ('A' - 10);

-897,7 +897,7 
struct per_thread_data *ptd = get_per_thread_data();
for (i = 0; host[i] != '\0'; i++)
- if (!ap_isdigit(host[i]) && host[i] != '.')
+ if (!isdigit((unsigned char)host[i]) && host[i] != '.')
break;
if (host[i] != '\0') {

-981,7 +981,7 
if (*addr == '/' && quads > 0) /* netmask starts here. */
break;
- if (!ap_isdigit(*addr))
+ if (!isdigit((unsigned char)*addr))
return 0; /* no digit at start of quad */
ip_addr[quads] = ap_strtol(addr, &tmp, 0);

-1003,7 +1003,7 
for (This->addr.s_addr = 0, i = 0; i < quads; ++i)
This->addr.s_addr |= htonl(ip_addr[i] << (24 - 8 * i));
- if (addr[0] == '/' && ap_isdigit(addr[1])) { /* net mask
follows: */
+ if (addr[0] == '/' && isdigit((unsigned char)addr[1])) { /* net
mask follows: */
char *tmp;
++addr;
Index: src/modules/standard/mod_access.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_access.c,v
retrieving revision 1.7
diff -u -r1.7 mod_access.c
--- src/modules/standard/mod_access.c 21 Nov 2003 18:12:49 -0000 1.7
+++ src/modules/standard/mod_access.c 1 Apr 2006 04:13:00 -0000

-139,7 +139,7 
static int is_ip(const char *host)
{
- while ((*host == '.') || ap_isdigit(*host))
+ while ((*host == '.') || isdigit((unsigned char)*host))
host++;
return (*host == '\0');
}

-207,7 +207,7 
a->x.ip.mask = mask;
a->x.ip.net.s_addr = (a->x.ip.net.s_addr & mask.s_addr); /*
pjr - This fixes PR 4770 */
}
- else if (ap_isdigit(*where) && is_ip(where)) {
+ else if (isdigit((unsigned char)*where) && is_ip(where)) {
/* legacy syntax for ip addrs: a.b.c. ==> a.b.c.0/24 for example */
int shift;
char *t;

-221,11 +221,11 
shift = 24;
while (*s) {
t = s;
- if (!ap_isdigit(*t)) {
+ if (!isdigit((unsigned char)*t)) {
a->type = T_FAIL;
return "invalid ip address";
}
- while (ap_isdigit(*t)) {
+ while (isdigit((unsigned char)*t)) {
++t;
}
if (*t == '.') {
Index: src/modules/standard/mod_alias.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_alias.c,v
retrieving revision 1.12
diff -u -r1.12 mod_alias.c
--- src/modules/standard/mod_alias.c 2 Dec 2004 19:42:47 -0000 1.12
+++ src/modules/standard/mod_alias.c 1 Apr 2006 04:13:00 -0000

-186,7 +186,7 
status = HTTP_MOVED_TEMPORARILY;
else if (!strcasecmp(arg1, "seeother"))
status = HTTP_SEE_OTHER;
- else if (ap_isdigit(*arg1))
+ else if (isdigit((unsigned char)*arg1))
status = atoi(arg1);
else {
f = arg1;
Index: src/modules/standard/mod_expires.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_expires.c,v
retrieving revision 1.8
diff -u -r1.8 mod_expires.c
--- src/modules/standard/mod_expires.c 21 Aug 2003 13:11:36 -0000 1.8
+++ src/modules/standard/mod_expires.c 1 Apr 2006 04:13:01 -0000

-285,7 +285,7 
while (word[0]) {
/* <num>
*/
- if (ap_isdigit(word[0])) {
+ if (isdigit((unsigned char)word[0])) {
num = atoi(word);
}
else {
Index: 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 -r1.8 mod_imap.c
--- src/modules/standard/mod_imap.c 20 Jan 2006 00:21:43 -0000 1.8
+++ src/modules/standard/mod_imap.c 1 Apr 2006 04:13:01 -0000

-260,7 +260,7 
return (-1); /* in case we aren't passed anything */
}
- while (*args && !ap_isdigit(*args) && *args != ',') {
+ while (*args && !isdigit((unsigned char)*args) && *args != ',') {
args++; /* jump to the first digit, but not past
a comma or end */
}

-292,7 +292,7 
start_of_y++; /* start looking at the character after
the comma */
- while (*start_of_y && !ap_isdigit(*start_of_y)) {
+ while (*start_of_y && !isdigit((unsigned char)*start_of_y)) {
start_of_y++; /* jump to the first digit, but not
past the end */
}

-749,14 +749,14 
while (ap_isspace(*string_pos)) { /* past whitespace */
string_pos++;
}
- while (ap_isdigit(*string_pos)) { /* and the 1st number */
+ while (isdigit((unsigned char)*string_pos)) { /* and 1st
number */
string_pos++;
}
string_pos++; /* skip the ',' */
while (ap_isspace(*string_pos)) { /* past any more
whitespace */
string_pos++;
}
- while (ap_isdigit(*string_pos)) { /* 2nd number */
+ while (isdigit((unsigned char)*string_pos)) { /* 2nd
number */
string_pos++;
}
vertex++;
Index: src/modules/standard/mod_include.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_include.c,v
retrieving revision 1.14
diff -u -r1.14 mod_include.c
--- src/modules/standard/mod_include.c 9 Feb 2005 12:13:10 -0000 1.14
+++ src/modules/standard/mod_include.c 1 Apr 2006 04:13:02 -0000

-300,7 +300,7 
/* is it numeric ? */
if (s[1] == '#') {
- for (j = 2, val = 0; j < i && ap_isdigit(s[j]); j++) {
+ for (j = 2, val = 0; j < i && isdigit((unsigned char)s[j]);
j++) {
val = val * 10 + s[j] - '0';
}
s += i;
Index: src/modules/standard/mod_log_config.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_log_config.c,v
retrieving revision 1.17
diff -u -r1.17 mod_log_config.c
--- src/modules/standard/mod_log_config.c 9 Feb 2005 12:13:10 -0000 1.17
+++ src/modules/standard/mod_log_config.c 1 Apr 2006 04:13:02 -0000

-717,7 +717,7 
case '8':
case '9':
i = *s - '0';
- while (ap_isdigit(*++s)) {
+ while (isdigit((unsigned char)*++s)) {
i = i * 10 + (*s) - '0';
}
if (!it->conditions) {
Index: src/modules/standard/mod_mime_magic.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_mime_magic.c,v
retrieving revision 1.9
diff -u -r1.9 mod_mime_magic.c
--- src/modules/standard/mod_mime_magic.c 9 Feb 2005 12:13:10 -0000 1.9
+++ src/modules/standard/mod_mime_magic.c 1 Apr 2006 04:13:02 -0000

-1115,7 +1115,7 
s = l;
if (*l == '+' || *l == '-')
l++;
- if (ap_isdigit((unsigned char) *l)) {
+ if (isdigit((unsigned char) *l)) {
m->in.offset = ap_strtol(l, &t, 0);
if (*s == '-')
m->in.offset = -m->in.offset;

-1130,7 +1130,7 
}
- while (ap_isdigit((unsigned char) *l))
+ while (isdigit((unsigned char) *l))
++l;
EATAB;

-1403,7 +1403,7 
/* Single hex char to int; -1 if not a hex char. */
static int hextoint(int c)
{
- if (ap_isdigit((unsigned char) c))
+ if (isdigit((unsigned char) c))
return c - '0';
if ((c >= 'a') && (c <= 'f'))
return c + 10 - 'a';

-2266,10 +2266,10 
/* check for recognized revision suffix */
suffix_pos = strlen(r->filename) - 1;
- if (!ap_isdigit(r->filename[suffix_pos])) {
+ if (!isdigit((unsigned char)r->filename[suffix_pos])) {
return 0;
}
- while (suffix_pos >= 0 && ap_isdigit(r->filename[suffix_pos]))
+ while (suffix_pos >= 0 && isdigit((unsigned
char)r->filename[suffix_pos]))
suffix_pos--;
if (suffix_pos < 0 || r->filename[suffix_pos] != '
') {
return 0;
Index: 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 -r1.8 mod_negotiation.c
--- src/modules/standard/mod_negotiation.c 9 Feb 2005 12:13:10 -0000 1.8
+++ src/modules/standard/mod_negotiation.c 1 Apr 2006 04:13:03 -0000

-547,7 +547,7 
if (strcmp(tok, "trans") == 0 ||
strcmp(tok, "vlist") == 0 ||
strcmp(tok, "guess-small") == 0 ||
- ap_isdigit(tok[0]) ||
+ isdigit((unsigned char)tok[0]) ||
strcmp(tok, "*") == 0) {
/* The user agent supports transparent negotiation */
Index: src/modules/standard/mod_rewrite.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_rewrite.c,v
retrieving revision 1.24
diff -u -r1.24 mod_rewrite.c
--- src/modules/standard/mod_rewrite.c 9 Feb 2005 12:13:10 -0000 1.24
+++ src/modules/standard/mod_rewrite.c 1 Apr 2006 04:13:04 -0000

-881,7 +881,7 
else if (strcasecmp(val, "seeother") == 0) {
status = HTTP_SEE_OTHER;
}
- else if (ap_isdigit(*val)) {
+ else if (isdigit((unsigned char)*val)) {
status = atoi(val);
}
if (!ap_is_HTTP_REDIRECT(status)) {

-2423,7 +2423,7 
space -= span;
continue;
}
- else if (ap_isdigit(inp[1])) {
+ else if (isdigit((unsigned char)inp[1])) {
int n = inp[1] - '0';
backrefinfo *bri = NULL;
if (inp[0] == '$') {
Index: src/modules/standard/mod_usertrack.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_usertrack.c,v
retrieving revision 1.12
diff -u -r1.12 mod_usertrack.c
--- src/modules/standard/mod_usertrack.c 6 Dec 2004 13:14:10 -0000 1.12
+++ src/modules/standard/mod_usertrack.c 1 Apr 2006 04:13:05 -0000

-365,7 +365,8 
cls = ap_get_module_config(parms->server->module_config,
&usertrack_module);
/* The simple case first - all numbers (we assume) */
- if (ap_isdigit(arg[0]) && ap_isdigit(arg[strlen(arg) - 1])) {
+ if (isdigit((unsigned char)arg[0]) &&
+ isdigit((unsigned char)arg[strlen(arg) - 1])) {
cls->expires = atol(arg);
return NULL;
}

-384,7 +385,7 
/* {<num> <type>}* */
while (word[0]) {
/* <num> */
- if (ap_isdigit(word[0]))
+ if (isdigit((unsigned char)word[0]))
num = atoi(word);
else
return "bad expires code, numeric value expected.";
Index: src/modules/standard/mod_vhost_alias.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/modules/standard/mod_vhost_alias.c,v
retrieving revision 1.8
diff -u -r1.8 mod_vhost_alias.c
--- src/modules/standard/mod_vhost_alias.c 21 Aug 2003 13:11:37 -0000 1.8
+++ src/modules/standard/mod_vhost_alias.c 1 Apr 2006 04:13:05 -0000

-214,7 +214,7 
++p;
}
/* digit N */
- if (ap_isdigit(*p)) {
+ if (isdigit((unsigned char)*p)) {
++p;
}
else {

-234,7 +234,7 
++p;
}
/* digit M */
- if (ap_isdigit(*p)) {
+ if (isdigit((unsigned char)*p)) {
++p;
}
else {
Index: src/regex/regcomp.c
===================================================================
RCS file: /cvs/src/usr.sbin/httpd/src/regex/regcomp.c,v
retrieving revision 1.6
diff -u -r1.6 regcomp.c
--- src/regex/regcomp.c 2 Dec 2004 19:42:48 -0000 1.6
+++ src/regex/regcomp.c 1 Apr 2006 04:13:05 -0000

-312,7 +312,7 
ordinary(p, c);
break;
case '{': /* okay as ordinary except if digit follows */
- REQUIRE(!MORE() || !ap_isdigit(PEEK()), REG_BADRPT);
+ REQUIRE(!MORE() || !isdigit((unsigned char)PEEK()), REG_BADRPT);
/* FALLTHROUGH */
default:
ordinary(p, c);

-324,7 +324,7 
c = PEEK();
/* we call { a repetition if followed by a digit */
if (!( c == '*' || c == '+' || c == '?' ||
- (c == '{' && MORE2() && ap_isdigit(PEEK2())) ))
+ (c == '{' && MORE2() && isdigit((unsigned char)PEEK2())) ))
return; /* no repetition, we're done */
NEXT1();

-353,7 +353,7 
case '{':
count = p_count(p);
if (EAT(',')) {
- if (ap_isdigit(PEEK())) {
+ if (isdigit((unsigned char)PEEK())) {
count2 = p_count(p);
REQUIRE(count <= count2, REG_BADBR);
} else /* single number with comma */

-373,8 +373,8 
if (!MORE())
return;
c = PEEK();
- if (!( c == '*' || c == '+' || c == '?' ||
- (c == '{' && MORE2() && ap_isdigit(PEEK2())) ) )
+ if (!( c == '*' || c == '+' || c == '?' ||
+ (c == '{' && MORE2() && isdigit((unsigned char)PEEK2())) ) )
return;
SETERROR(REG_BADRPT);
}

-531,7 +531,7 
} else if (EATTWO('\\', '{')) {
count = p_count(p);
if (EAT(',')) {
- if (MORE() && ap_isdigit(PEEK())) {
+ if (MORE() && isdigit((unsigned char)PEEK())) {
count2 = p_count(p);
REQUIRE(count <= count2, REG_BADBR);
} else /* single number with comma */

-562,7 +562,7 
register int count = 0;
register int ndigits = 0;
- while (MORE() && ap_isdigit(PEEK()) && count <= DUPMAX) {
+ while (MORE() && isdigit((unsigned char)PEEK()) && count <= DUPMAX) {
count = count*10 + (GETNEXT() - '0');
ndigits++;
}
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]