mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
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
This commit is contained in:
parent
a10591ac8c
commit
460d8c11cd
1 changed files with 1 additions and 2 deletions
3
string.c
3
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;
|
||||
|
|
Loading…
Reference in a new issue