mirror of
https://codeberg.org/ziglang/zig.git
synced 2025-12-06 05:44:20 +00:00
Fix buffer overflow in fmt when DAZ is set
This commit is contained in:
parent
0a03d68594
commit
edd9d73b0d
1 changed files with 2 additions and 1 deletions
|
|
@ -169,7 +169,8 @@ fn errolSlow(val: f64, buffer: []u8) FloatDecimal {
|
||||||
|
|
||||||
// digit generation
|
// digit generation
|
||||||
var buf_index: usize = 0;
|
var buf_index: usize = 0;
|
||||||
while (true) {
|
const bound = buffer.len - 1;
|
||||||
|
while (buf_index < bound) {
|
||||||
var hdig = @floatToInt(u8, @floor(high.val));
|
var hdig = @floatToInt(u8, @floor(high.val));
|
||||||
if ((high.val == @intToFloat(f64, hdig)) and (high.off < 0)) hdig -= 1;
|
if ((high.val == @intToFloat(f64, hdig)) and (high.off < 0)) hdig -= 1;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue