summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/string.c b/string.c
index 9a9de2e64b..3f348f2662 100644
--- a/string.c
+++ b/string.c
@@ -1569,6 +1569,7 @@ rb_str_rindex(VALUE str, VALUE sub, long pos)
sbeg = RSTRING_PTR(str);
e = RSTRING_END(str);
t = RSTRING_PTR(sub);
+ slen = RSTRING_LEN(sub);
for (;;) {
s = str_nth(sbeg, e, pos, enc, asc);
if (!s) return -1;