summaryrefslogtreecommitdiffhomepage
path: root/mrbgems/mruby-print
diff options
context:
space:
mode:
authorksss <[email protected]>2014-03-05 15:06:29 +0000
committerksss <[email protected]>2014-03-06 13:47:51 +0000
commit54132e436494b4797ca53cbd934963e7d752ac42 (patch)
treec490aee6faa4fbcc8aac66b205b5087af4c208bc /mrbgems/mruby-print
parent4070b5987a76a2d633a99e137035749559e2da59 (diff)
downloadmruby-54132e436494b4797ca53cbd934963e7d752ac42.tar.gz
mruby-54132e436494b4797ca53cbd934963e7d752ac42.zip
make embed string when create literals
Diffstat (limited to 'mrbgems/mruby-print')
-rw-r--r--mrbgems/mruby-print/src/print.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/mrbgems/mruby-print/src/print.c b/mrbgems/mruby-print/src/print.c
index 0cdbad6d4..e4e52624f 100644
--- a/mrbgems/mruby-print/src/print.c
+++ b/mrbgems/mruby-print/src/print.c
@@ -5,14 +5,12 @@
static void
printstr(mrb_state *mrb, mrb_value obj)
{
- struct RString *str;
char *s;
int len;
if (mrb_string_p(obj)) {
- str = mrb_str_ptr(obj);
- s = str->as.heap.ptr;
- len = str->as.heap.len;
+ s = RSTRING_PTR(obj);
+ len = RSTRING_LEN(obj);
fwrite(s, len, 1, stdout);
}
}