aboutsummaryrefslogtreecommitdiffstats
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/string.c b/string.c
index bbbf2f506a..1d30a153cb 100644
--- a/string.c
+++ b/string.c
@@ -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) {