use return value from sprintf/snprintf

This commit is contained in:
Yukihiro Matsumoto
2012-06-27 15:14:56 +09:00
parent cf8b6ec841
commit 6f9ed1c5b2
4 changed files with 19 additions and 21 deletions
+2 -2
View File
@@ -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;
}
}