summaryrefslogtreecommitdiffhomepage
path: root/src/string.c
diff options
context:
space:
mode:
authorYukihiro Matsumoto <[email protected]>2012-06-27 15:14:56 +0900
committerYukihiro Matsumoto <[email protected]>2012-06-27 15:14:56 +0900
commit6f9ed1c5b21ba6ef2230e15bd3b39535f2f7bde9 (patch)
tree03836b10b755dbe8253e27272a3adef196db41f7 /src/string.c
parentcf8b6ec8418ce3970a82b80d514a17b0ffa61b53 (diff)
downloadmruby-6f9ed1c5b21ba6ef2230e15bd3b39535f2f7bde9.tar.gz
mruby-6f9ed1c5b21ba6ef2230e15bd3b39535f2f7bde9.zip
use return value from sprintf/snprintf
Diffstat (limited to 'src/string.c')
-rw-r--r--src/string.c4
1 files changed, 2 insertions, 2 deletions
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;
}
}