szn

Bug 215 — Pane-border format written byte-by-byte — corrupts UTF-8 / invalid codepoints

215. Pane-border format written byte-by-byte — corrupts UTF-8 / invalid codepoints

File: src/server/render.zig:285 Severity: LOW Status: ✅ FIXED — loop now decodes UTF-8 into full codepoints and assigns cell.char (a u21) per display column.

cell.char = fmt[i];

fmt is the expanded border string and cell.char is u21 (a full Unicode codepoint). Indexing the string byte-by-byte and assigning each raw UTF-8 byte into a u21 is wrong for any multi-byte border content: it scatters UTF-8 continuation bytes across separate cells and stores invalid codepoint values. Harmless for the default ASCII "#I", but corrupts non-ASCII border formats.

Fix: Iterate the string by decoded codepoint (std.unicode.utf8Decode), advance one display column per codepoint, and assign the decoded u21 to cell.char.


Updated Summary

Severity Count Fixed False Positive Unresolved
Critical 25 23 3 0
High 48 48 1 0
Medium 73 (70+3) 76 3 0
Low 64 (63+1) 70 3 0
Total 210 (206+4) 213 10 0

NEW BUGS (2026-07-22 — deep code audit)

Found during a comprehensive line-by-line audit of the entire codebase (~39 .zig files, ~15,000 LOC).