avoid integer underflow when negative
This commit is contained in:
parent
528a5b5c56
commit
d5b63ccd51
1 changed files with 1 additions and 1 deletions
|
|
@ -190,7 +190,7 @@ fn renderHourlyCell(w: *std.Io.Writer, hour: types.HourlyForecast, line: usize,
|
||||||
const buffered = cell_writer.buffered();
|
const buffered = cell_writer.buffered();
|
||||||
const display_width = art_width + buffered.len - counting_writer.invisible_bytes;
|
const display_width = art_width + buffered.len - counting_writer.invisible_bytes;
|
||||||
try w.writeAll(buffered);
|
try w.writeAll(buffered);
|
||||||
try w.splatByteAll(' ', @max(total_width - display_width, 0));
|
try w.splatByteAll(' ', @max(@as(isize, total_width) - @as(isize, @intCast(display_width)), 0));
|
||||||
}
|
}
|
||||||
|
|
||||||
const DateFormat = enum {
|
const DateFormat = enum {
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue