From c7f540ed6721b735815af8eee5a69b22b6142b50 Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Thu, 31 May 2012 16:14:50 +0900 Subject: reimplement String#upcase --- src/string.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index c9fac896d..c000a9d7c 100644 --- a/src/string.c +++ b/src/string.c @@ -2583,7 +2583,8 @@ mrb_str_upcase_bang(mrb_state *mrb, mrb_value str) char *s, *send; int modify = 0; - s = RSTRING(str)->buf; send = s + RSTRING(str)->len; + s = RSTRING_PTR(str); + send = RSTRING_END(str); while (s < send) { if (ISLOWER(*s)) { *s = toupper(*s); -- cgit v1.2.3