]> granicus.if.org Git - php/commitdiff
MFH
authorMoriyoshi Koizumi <moriyoshi@php.net>
Mon, 24 Feb 2003 16:56:25 +0000 (16:56 +0000)
committerMoriyoshi Koizumi <moriyoshi@php.net>
Mon, 24 Feb 2003 16:56:25 +0000 (16:56 +0000)
ext/ereg/ereg.c
ext/standard/reg.c

index 964fc6db3ebb50d5605fa35e778fc372be7a4f97..2af1fefb3a592afec5ec3cb677fa81b33ae8061e 100644 (file)
@@ -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;
                                        }    
index 964fc6db3ebb50d5605fa35e778fc372be7a4f97..2af1fefb3a592afec5ec3cb677fa81b33ae8061e 100644 (file)
@@ -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;
                                        }