mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Check return value from snprintf(); ref #3498
This commit is contained in:
@@ -1087,6 +1087,9 @@ retry:
|
||||
|
||||
CHECK(need);
|
||||
n = snprintf(&buf[blen], need, fbuf, fval);
|
||||
if (n < 0) {
|
||||
mrb_raise(mrb, E_RUNTIME_ERROR, "formatting error");
|
||||
}
|
||||
blen += n;
|
||||
}
|
||||
break;
|
||||
|
||||
Reference in New Issue
Block a user