Skip to content

Commit 93b6d05

Browse files
author
Moriyoshi Koizumi
committed
Forgot to fix this part
1 parent a67e4da commit 93b6d05

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

ext/ereg/ereg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const cha
324324
new_l = strlen(buf) + subs[0].rm_so; /* part before the match */
325325
walk = replace;
326326
while (*walk) {
327-
if ('\\' == *walk && isdigit(walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
327+
if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
328328
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) {
329329
new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so;
330330
}

ext/standard/reg.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -324,7 +324,7 @@ PHPAPI char *php_reg_replace(const char *pattern, const char *replace, const cha
324324
new_l = strlen(buf) + subs[0].rm_so; /* part before the match */
325325
walk = replace;
326326
while (*walk) {
327-
if ('\\' == *walk && isdigit(walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
327+
if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
328328
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) {
329329
new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so;
330330
}

0 commit comments

Comments
 (0)