mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
fixup! Check return value from snprintf(); ref #3498
This commit is contained in:
@@ -1049,7 +1049,10 @@ retry:
|
||||
need = width;
|
||||
|
||||
CHECK(need + 1);
|
||||
snprintf(&buf[blen], need + 1, "%*s", need, "");
|
||||
n = snprintf(&buf[blen], need + 1, "%*s", need, "");
|
||||
if (n < 0) {
|
||||
mrb_raise(mrb, E_RUNTIME_ERROR, "formatting error");
|
||||
}
|
||||
if (flags & FMINUS) {
|
||||
if (!isnan(fval) && fval < 0.0)
|
||||
buf[blen++] = '-';
|
||||
|
||||
Reference in New Issue
Block a user