diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-13 12:31:01 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-05-13 12:31:01 +0000 |
commit | 233e4689a3da0ea6d7b70abdbae5dd67f2eebb06 (patch) | |
tree | 47211683ee6a6983a53079bdc0bde7fcad134c35 /string.c | |
parent | 1808ad8a47c59829ae874e028d723e7091ffa045 (diff) | |
download | ruby-233e4689a3da0ea6d7b70abdbae5dd67f2eebb06.tar.gz |
string.c: fix one-off bug
* string.c (rb_str_cat_conv_enc_opts): fix one-off bug. `ofs`
equals `olen` when appending at the end.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58702 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -917,7 +917,7 @@ rb_str_cat_conv_enc_opts(VALUE newstr, long ofs, const char *ptr, long len, long olen; olen = RSTRING_LEN(newstr); - if (ofs < -olen || olen <= ofs) + if (ofs < -olen || olen < ofs) rb_raise(rb_eIndexError, "index %ld out of string", ofs); if (ofs < 0) ofs += olen; if (!from) { |