aboutsummaryrefslogtreecommitdiffstats
path: root/re.c
diff options
context:
space:
mode:
Diffstat (limited to 're.c')
-rw-r--r--re.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/re.c b/re.c
index 2d786f5cef..95ba903480 100644
--- a/re.c
+++ b/re.c
@@ -3243,8 +3243,8 @@ rb_reg_match_m_p(int argc, VALUE *argv, VALUE re)
if (pos < 0) return Qfalse;
}
if (pos > 0) {
- long len = 0;
- char *beg = rb_str_subpos(str, pos, &len);
+ long len = 1;
+ const char *beg = rb_str_subpos(str, pos, &len);
if (!beg) return Qfalse;
pos = beg - RSTRING_PTR(str);
}