summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string.c b/src/string.c
index a5de9f557..22e3dad60 100644
--- a/src/string.c
+++ b/src/string.c
@@ -1411,7 +1411,7 @@ mrb_str_index(mrb_state *mrb, mrb_value str, mrb_value sub, mrb_int offset)
s = t;
}
#else
- pos = mrb_memsearch(sptr, slen, s+offset, len-offset);
+ pos = mrb_memsearch(sptr, slen, s, len);
if (pos < 0) return pos;
#endif //INCLUDE_ENCODING
return pos + offset;