mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 06:13:07 +00:00
Fix buffer overflow in fmt when DAZ is set
This commit is contained in:
parent
0a03d68594
commit
edd9d73b0d
@ -169,7 +169,8 @@ fn errolSlow(val: f64, buffer: []u8) FloatDecimal {
|
||||
|
||||
// digit generation
|
||||
var buf_index: usize = 0;
|
||||
while (true) {
|
||||
const bound = buffer.len - 1;
|
||||
while (buf_index < bound) {
|
||||
var hdig = @floatToInt(u8, @floor(high.val));
|
||||
if ((high.val == @intToFloat(f64, hdig)) and (high.off < 0)) hdig -= 1;
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user