summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/string.c b/src/string.c
index c74dcedde..8e61e6bb9 100644
--- a/src/string.c
+++ b/src/string.c
@@ -2983,12 +2983,12 @@ mrb_str_inspect(mrb_state *mrb, mrb_value str)
continue;
}
else {
- sprintf(buf, "\\%03o", c & 0377);
- mrb_str_buf_cat(mrb, result, buf, strlen(buf));
+ int n = sprintf(buf, "\\%03o", c & 0377);
+ mrb_str_buf_cat(mrb, result, buf, n);
continue;
}
}
- mrb_str_buf_cat(mrb, result, "\"", sizeof("\""));
+ mrb_str_buf_cat(mrb, result, "\"", 1);
return result;
}