From a821fe82d8de3d407ebe104358b97719bd983727 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 13:16:18 -0300 Subject: idioms #19, unreachable only where the type bounds it: the prints that carry a path, a name, a miss or a reason (Core's shell and Dump words, colors' theme file, look's misses and refusals) cut through Kind.Buf at their old size, the header texts flatSurface could still fail on and colors' putName handle the failure again, and every kept site (integers, a same-statement cut into a [K + room] buffer, the hashing and discarding writers) says its bound on its line Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/modal.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/modal.zig') diff --git a/src/modal.zig b/src/modal.zig index a6781af3..89046820 100644 --- a/src/modal.zig +++ b/src/modal.zig @@ -1459,7 +1459,7 @@ pub fn incrementDecimal(alloc: std.mem.Allocator, frag: []const u8, amount: i64) if (!neg and neg_after) flen += 1; var buf: [48]u8 = undefined; // "{d}" prints '+' for positive signed ints — format the magnitude unsigned - const mag = std.fmt.bufPrint(&buf, "{d}", .{@abs(nv)}) catch unreachable; // a u128 is 39 digits + const mag = std.fmt.bufPrint(&buf, "{d}", .{@abs(nv)}) catch unreachable; // a u128's 39 digits fit 48 const sign_len: usize = @intFromBool(neg_after); const want = if (pad) flen - sign_len else mag.len; const digits_len = @max(want, mag.len); -- cgit v1.3