Browse Source

MFB: fix warning

PHAR_1_2
Jani Taskinen 19 years ago
parent
commit
c4e82d3cb9
  1. 2
      ext/ereg/ereg.c
  2. 2
      ext/standard/reg.c

2
ext/ereg/ereg.c

@ -355,7 +355,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 */ new_l = strlen(buf) + subs[0].rm_so; /* part before the match */
walk = replace; walk = replace;
while (*walk) { while (*walk) {
if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= (int)re.re_nsub) {
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) { 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; new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so;
} }

2
ext/standard/reg.c

@ -355,7 +355,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 */ new_l = strlen(buf) + subs[0].rm_so; /* part before the match */
walk = replace; walk = replace;
while (*walk) { while (*walk) {
if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= re.re_nsub) {
if ('\\' == *walk && isdigit((unsigned char)walk[1]) && ((unsigned char)walk[1]) - '0' <= (int)re.re_nsub) {
if (subs[walk[1] - '0'].rm_so > -1 && subs[walk[1] - '0'].rm_eo > -1) { 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; new_l += subs[walk[1] - '0'].rm_eo - subs[walk[1] - '0'].rm_so;
} }

Loading…
Cancel
Save