1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

RSTRING_LEN was not used

This commit is contained in:
Nobuyoshi Nakada 2020-08-14 16:12:58 +09:00
parent 4318aba9c9
commit e658040266
No known key found for this signature in database
GPG key ID: 7CD2805BFA3770C6

4
re.c
View file

@ -3518,9 +3518,7 @@ rb_reg_quote(VALUE str)
}
t = RSTRING_PTR(tmp);
/* copy upto metacharacter */
const char *p;
long MAYBE_UNUSED(n);
RSTRING_GETMEM(str, p, n);
const char *p = RSTRING_PTR(str);
memcpy(t, p, s - p);
t += s - p;