szn

Bug 162 — mode_copy.zig — @intCast of history.items.len (usize) to u32

162. mode_copy.zig — @intCast of history.items.len (usize) to u32

File: src/mode_copy.zig:103, 125 Severity: LOW Status: ✅ FIXED — use @min(grid.history.items.len, maxInt(u32)) guard before @intCast.

self.scroll_offset = @min(self.scroll_offset + remaining, @as(u32, @intCast(grid.history.items.len)));

If history ever exceeds maxInt(u32) (~4 billion entries), this is a runtime panic. The history_limit is u32 so it’s unlikely in practice, but the cast is technically unsafe.