summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-14 17:40:32 +0000
committernobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-07-14 17:40:32 +0000
commit460d8c11cd45ff3e85cb90551c7edabc2c831264 (patch)
tree1a1ad16378f8014815b66d1e1124e0f678d13e8a
parenta10591ac8c21dcac8189e6d31f1f1016aa62707f (diff)
string.c: char length
* string.c (str_null_char): calculate char length. fix commit miss at r41967. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@41971 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--string.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/string.c b/string.c
index 3e677c4a9e3..2e1147adb36 100644
--- a/string.c
+++ b/string.c
@@ -1494,10 +1494,9 @@ zero_filled(const char *s, int n)
static const char *
str_null_char(const char *s, long len, const int minlen, rb_encoding *enc)
{
- int n;
const char *e = s + len;
- for (; s + minlen <= e; s += n) {
+ for (; s + minlen <= e; s += rb_enc_mbclen(s, e, enc)) {
if (zero_filled(s, minlen)) return s;
}
return 0;