summaryrefslogtreecommitdiffhomepage
path: root/src/variable.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/variable.c')
-rw-r--r--src/variable.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/variable.c b/src/variable.c
index 3dcdbf775..90f0831da 100644
--- a/src/variable.c
+++ b/src/variable.c
@@ -563,10 +563,11 @@ inspect_i(mrb_state *mrb, mrb_sym sym, mrb_value v, void *p)
const char *s;
mrb_int len;
mrb_value ins;
+ char *sp = RSTRING_PTR(str);
/* need not to show internal data */
- if (RSTRING_PTR(str)[0] == '-') { /* first element */
- RSTRING_PTR(str)[0] = '#';
+ if (sp[0] == '-') { /* first element */
+ sp[0] = '#';
mrb_str_cat_lit(mrb, str, " ");
}
else {