summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShugo Maeda <shugo@ruby-lang.org>2022-02-23 11:23:33 +0900
committerShugo Maeda <shugo@ruby-lang.org>2022-02-23 11:23:33 +0900
commit63401b1384d206e3689bea5f5e4f06b7872b9ada (patch)
tree17fa690ccd936b02b23ecce5c1319db3cfb8326d
parent68847794bf8068db2bf8c940e9478b07fb16c839 (diff)
Rename the wrong variable name `beg` to `len`
-rw-r--r--string.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/string.c b/string.c
index b879e417b8..986eee945c 100644
--- a/string.c
+++ b/string.c
@@ -6332,9 +6332,9 @@ static VALUE
rb_str_byteslice(int argc, VALUE *argv, VALUE str)
{
if (argc == 2) {
- long beg = NUM2LONG(argv[0]);
- long end = NUM2LONG(argv[1]);
- return str_byte_substr(str, beg, end, TRUE);
+ long beg = NUM2LONG(argv[0]);
+ long len = NUM2LONG(argv[1]);
+ return str_byte_substr(str, beg, len, TRUE);
}
rb_check_arity(argc, 1, 2);
return str_byte_aref(str, argv[0]);