From 6f9ed1c5b21ba6ef2230e15bd3b39535f2f7bde9 Mon Sep 17 00:00:00 2001 From: Yukihiro Matsumoto Date: Wed, 27 Jun 2012 15:14:56 +0900 Subject: use return value from sprintf/snprintf --- src/string.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/string.c') diff --git a/src/string.c b/src/string.c index c74dcedde..f01c08bce 100644 --- a/src/string.c +++ b/src/string.c @@ -2983,8 +2983,8 @@ 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; } } -- cgit v1.2.3