diff options
Diffstat (limited to 'string.c')
-rw-r--r-- | string.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -5254,7 +5254,7 @@ str_byte_substr(VALUE str, long beg, long len, int empty) beg += n; if (beg < 0) return Qnil; } - if (beg + len > n) + if (len > n - beg) len = n - beg; if (len <= 0) { if (!empty) return Qnil; |