diff options
author | Marcus Boerger <helly@php.net> | 2007-03-06 01:19:47 +0000 |
---|---|---|
committer | Marcus Boerger <helly@php.net> | 2007-03-06 01:19:47 +0000 |
commit | 331034afbb65289f38a05f1ad300b8efcab7f395 (patch) | |
tree | c2099f9039cd8652657fbe88a5d2d4657816f240 /ext/mbstring/oniguruma | |
parent | 3c21c05e43befa4127006880e0000c6fd9ec5965 (diff) | |
download | php-git-331034afbb65289f38a05f1ad300b8efcab7f395.tar.gz |
- Revert last part and fix issue under windows
Diffstat (limited to 'ext/mbstring/oniguruma')
-rw-r--r-- | ext/mbstring/oniguruma/regerror.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ext/mbstring/oniguruma/regerror.c b/ext/mbstring/oniguruma/regerror.c index da71975964..4888fe00f4 100644 --- a/ext/mbstring/oniguruma/regerror.c +++ b/ext/mbstring/oniguruma/regerror.c @@ -278,7 +278,7 @@ onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist) 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 @@ onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist) 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 @@ onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist) } 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++; |