summaryrefslogtreecommitdiff
path: root/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'string.c')
-rw-r--r--string.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/string.c b/string.c
index ca4ad9cf615..3a278b898f2 100644
--- a/string.c
+++ b/string.c
@@ -913,7 +913,7 @@ str_sub_s(str, pat, val, once)
}
if (once) break;
- if (offset >= STRLEN(str)) break;
+ if (offset > STRLEN(str)) break;
}
if (n == 0) return Qnil;
if (RSTRING(str)->len > offset) {
@@ -996,7 +996,7 @@ str_sub_iter_s(str, pat, once)
}
if (once) break;
- if (offset >= STRLEN(str)) break;
+ if (offset > STRLEN(str)) break;
}
if (n == 0) return Qnil;
if (RSTRING(str)->len > offset) {