aboutsummaryrefslogtreecommitdiffstats
path: root/sjis.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 /sjis.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 'sjis.c')
-rw-r--r--sjis.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/sjis.c b/sjis.c
index 9bfae90172..f14139e561 100644
--- a/sjis.c
+++ b/sjis.c
@@ -71,7 +71,7 @@ static const char SJIS_CAN_BE_TRAIL_TABLE[256] = {
#define SJIS_ISMB_TRAIL(byte) SJIS_CAN_BE_TRAIL_TABLE[(byte)]
static int
-mbc_enc_len(const UChar* p)
+mbc_enc_len(const UChar* p, const UChar* e)
{
return EncLen_SJIS[*p];
}
@@ -98,7 +98,7 @@ mbc_to_code(const UChar* p, const UChar* end)
int c, i, len;
OnigCodePoint n;
- len = enc_len(ONIG_ENCODING_SJIS, p);
+ len = enc_len(ONIG_ENCODING_SJIS, p, end);
c = *p++;
n = c;
if (len == 1) return n;
@@ -139,7 +139,7 @@ mbc_case_fold(OnigCaseFoldType flag,
}
else {
int i;
- int len = enc_len(ONIG_ENCODING_SJIS, p);
+ int len = enc_len(ONIG_ENCODING_SJIS, p, end);
for (i = 0; i < len; i++) {
*lower++ = *p++;
@@ -192,7 +192,7 @@ left_adjust_char_head(const UChar* start, const UChar* s)
}
}
}
- len = enc_len(ONIG_ENCODING_SJIS, p);
+ len = enc_len(ONIG_ENCODING_SJIS, p, s);
if (p + len > s) return (UChar* )p;
p += len;
return (UChar* )(p + ((s - p) & ~1));