summaryrefslogtreecommitdiffhomepage
path: root/src
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-05-31 16:14:50 +0900
committerYukihiro Matsumoto <[email protected]>2012-05-31 16:14:50 +0900
commitc7f540ed6721b735815af8eee5a69b22b6142b50 (patch)
treea694d8018eeaaf277b6826ef244fde434875f6b6 /src
parent86697ca7b47ee826598c30948549651e662f09e3 (diff)
downloadmruby-c7f540ed6721b735815af8eee5a69b22b6142b50.tar.gz
mruby-c7f540ed6721b735815af8eee5a69b22b6142b50.zip
reimplement String#upcase
Diffstat (limited to 'src')
-rw-r--r--src/string.c3
1 files changed, 2 insertions, 1 deletions
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);