diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/string.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c index 9efc89b34..c36b7524a 100644 --- a/src/string.c +++ b/src/string.c @@ -1608,7 +1608,7 @@ mrb_str_index(mrb_state *mrb, mrb_value str) return mrb_nil_value(); } } - if (pos >= clen) return mrb_nil_value(); + if (pos > clen) return mrb_nil_value(); pos = chars2bytes(str, 0, pos); switch (mrb_type(sub)) { |
