cvs: php-src(PHP_5_2) /ext/mbstring/oniguruma regerror.c
| From: | Marcus Boerger | Date: | Tue, 06 Mar 2007 01:19:48 +0000 |
| Subject: | cvs: php-src(PHP_5_2) /ext/mbstring/oniguruma regerror.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-43425@lists.php.net to get a copy of this message | ||
helly Tue Mar 6 01:19:48 2007 UTC
Modified files: (Branch: PHP_5_2)
/php-src/ext/mbstring/oniguruma regerror.c
Log:
- Revert last part and fix issue under windows
http://cvs.php.net/viewvc.cgi/php-src/ext/mbstring/oniguruma/regerror.c?r1=1.3.4.7&r2=1.3.4.8&diff_format=u
Index: php-src/ext/mbstring/oniguruma/regerror.c
diff -u php-src/ext/mbstring/oniguruma/regerror.c:1.3.4.7
php-src/ext/mbstring/oniguruma/regerror.c:1.3.4.8
--- php-src/ext/mbstring/oniguruma/regerror.c:1.3.4.7 Wed Feb 28 01:10:41 2007
+++ php-src/ext/mbstring/oniguruma/regerror.c Tue Mar 6 01:19:47 2007
@@ -278,7 +278,7 @@
va_init_list(args, fmt);
n = vsnprintf((char* )buf, bufsize, (const char* )fmt, args);
- if (n >= bufsize) {
+ if (n < 0 || n >= bufsize) {
n = bufsize - 1;
}
va_end(args);
@@ -309,7 +309,7 @@
int blen;
while (len-- > 0) {
- snprintf((char* )bs, sizeof(bs), "\\%03o", *p++ & 0377);
+ sprintf((char* )bs, "\\%03o", *p++ & 0377);
blen = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);
bp = bs;
while (blen-- > 0) *s++ = *bp++;
@@ -318,7 +318,7 @@
}
else if (!ONIGENC_IS_CODE_PRINT(enc, *p) &&
!ONIGENC_IS_CODE_SPACE(enc, *p)) {
- snprintf((char* )bs, sizeof(bs), "\\%03o", *p++ & 0377);
+ sprintf((char* )bs, "\\%03o", *p++ & 0377);
len = onigenc_str_bytelen_null(ONIG_ENCODING_ASCII, bs);
bp = bs;
while (len-- > 0) *s++ = *bp++;