From: Rui Hirokawa Date: Tue, 23 Sep 2003 02:54:28 +0000 (+0000) Subject: removed unnessesary null byte (patched by komura). X-Git-Tag: php-4.3.4RC1~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5714f48f4cdc700b4fd9b04ad8c6b8003895b765;p=php removed unnessesary null byte (patched by komura). --- diff --git a/ext/mbstring/php_mbregex.c b/ext/mbstring/php_mbregex.c index 63f84c52b2..488a999b8f 100644 --- a/ext/mbstring/php_mbregex.c +++ b/ext/mbstring/php_mbregex.c @@ -557,7 +557,12 @@ _php_mb_regex_ereg_replace_exec(INTERNAL_FUNCTION_PARAMETERS, int option) } } else { /* nomatch */ /* stick that last bit of string on our output */ - _php_mb_regex_strbuf_ncat(&outdev, (const unsigned char *)&string[pos], string_len - pos); + int l = string_len - pos; + if (l > 0) { + _php_mb_regex_strbuf_ncat(&outdev, (const unsigned char *)&string[pos], l); + } else { + outdev.pos += l; + } } } @@ -1083,3 +1088,12 @@ PHP_FUNCTION(mb_regex_set_options) /* }}} */ #endif /* HAVE_MBREGEX */ + +/* + * Local variables: + * tab-width: 4 + * c-basic-offset: 4 + * End: + * vim600: fdm=marker + * vim: noet sw=4 ts=4 + */