summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMoriyoshi Koizumi <moriyoshi@php.net>2003-02-24 16:56:25 +0000
committerMoriyoshi Koizumi <moriyoshi@php.net>2003-02-24 16:56:25 +0000
commitc6a8a1bf044606be9c710411e377d93eff3ec951 (patch)
tree3a0f739e82055929233070cca4322432ef04b87e
parentea23f45b36c860230340438450bb0c711e387d40 (diff)
downloadphp-git-c6a8a1bf044606be9c710411e377d93eff3ec951.tar.gz
MFH
-rw-r--r--ext/ereg/ereg.c2
-rw-r--r--ext/standard/reg.c2
2 files changed, 2 insertions, 2 deletions
diff --git a/ext/ereg/ereg.c b/ext/ereg/ereg.c
index 964fc6db3e..2af1fefb3a 100644
--- a/ext/ereg/ereg.c
+++ b/ext/ereg/ereg.c
@@ -324,7 +324,7 @@ PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const cha
new_l = strlen(buf) + subs[0].rm_so; /* part before the match */
walk = replace;
while (*walk) {
- if ('\\' == *walk && isdigit(walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
+ if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) {
new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so;
}
diff --git a/ext/standard/reg.c b/ext/standard/reg.c
index 964fc6db3e..2af1fefb3a 100644
--- a/ext/standard/reg.c
+++ b/ext/standard/reg.c
@@ -324,7 +324,7 @@ PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const cha
new_l = strlen(buf) + subs[0].rm_so; /* part before the match */
walk = replace;
while (*walk) {
- if ('\\' == *walk && isdigit(walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
+ if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) {
new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so;
}