summaryrefslogtreecommitdiff
path: root/regerror.c
diff options
context:
space:
mode:
authormatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-06 12:33:45 +0000
committermatz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2007-09-06 12:33:45 +0000
commitedd7c787adc53f70a9d2790076e4c6d77a1f5324 (patch)
tree0b19582f07ef27790bde97603bd271efb88bcb35 /regerror.c
parent629b1e4324ecfbdb9e953f2a0da74a833786e1e9 (diff)
downloadruby-edd7c787adc53f70a9d2790076e4c6d77a1f5324.tar.gz
* array.c (rb_ary_cycle): typo in rdoc. a patch from Yugui
<yugui@yugui.sakura.ne.jp>. [ruby-dev:31748] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@13348 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'regerror.c')
-rw-r--r--regerror.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/regerror.c b/regerror.c
index b0cc71d18d..61187d4a61 100644
--- a/regerror.c
+++ b/regerror.c
@@ -209,7 +209,7 @@ static int to_ascii(OnigEncoding enc, UChar *s, UChar *end,
buf[len++] = (UChar )code;
}
- p += enc_len(enc, p);
+ p += enc_len(enc, p, end);
if (len >= buf_size) break;
}
@@ -330,15 +330,15 @@ onig_snprintf_with_pattern(buf, bufsize, enc, pat, pat_end, fmt, va_alist)
while (p < pat_end) {
if (*p == '\\') {
*s++ = *p++;
- len = enc_len(enc, p);
+ len = enc_len(enc, p, pat_end);
while (len-- > 0) *s++ = *p++;
}
else if (*p == '/') {
*s++ = (unsigned char )'\\';
*s++ = *p++;
}
- else if (ONIGENC_IS_MBC_HEAD(enc, p)) {
- len = enc_len(enc, p);
+ else if (ONIGENC_IS_MBC_HEAD(enc, p, pat_end)) {
+ len = enc_len(enc, p, pat_end);
if (ONIGENC_MBC_MINLEN(enc) == 1) {
while (len-- > 0) *s++ = *p++;
}