diff -ur php-4.3.3.orig/ext/mbstring/php_mbregex.c php-4.3.3/ext/mbstring/php_mbregex.c --- php-4.3.3.orig/ext/mbstring/php_mbregex.c Fri May 2 06:08:25 2003 +++ php-4.3.3/ext/mbstring/php_mbregex.c Mon Sep 22 00:05:46 2003 @@ -557,7 +557,12 @@ } } 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; + } } }