diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 13:13:17 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 14:56:36 -0300 |
| commit | 4917ae452a15ff4f32d97d215a99fdcfaab29d61 (patch) | |
| tree | 56e25907532aed6222807503bc7904fc34781e31 /src/main.zig | |
| parent | cf9e075d3537698e76a8fb22dc1a63622ca78c45 (diff) | |
| download | pardes-4917ae452a15ff4f32d97d215a99fdcfaab29d61.tar.gz pardes-4917ae452a15ff4f32d97d215a99fdcfaab29d61.zip | |
idioms #9, every catch unreachable this slice added is a fact of the code: each formats integers, literals, an error's name or a slice of a fixed array (the daemon's [128]u8 names, the cache's path_buf, main's cwd_buf, those two buffers now sized from their arrays), so all 39 stay, each with its reason on its own line
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/main.zig')
| -rw-r--r-- | src/main.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main.zig b/src/main.zig index 3401c0b4..7f6d1a05 100644 --- a/src/main.zig +++ b/src/main.zig @@ -156,8 +156,8 @@ fn pageInto(io: std.Io, gpa: std.mem.Allocator, dial: []const u8, text: []const const plain = for (cwd) |c| { if (c < ' ' or c == 0x7f) break false; } else !pardes.filesystem.deniedAbove(cwd); - var line_buf: [4200]u8 = undefined; - const dir_line = std.fmt.bufPrint(&line_buf, "{s}\n", .{if (plain) cwd else ""}) catch unreachable; // a cwd of 4096 fits 4200 + var line_buf: [cwd_buf.len + 1]u8 = undefined; + const dir_line = std.fmt.bufPrint(&line_buf, "{s}\n", .{if (plain) cwd else ""}) catch unreachable; // a cwd out of cwd_buf and "\n" fit // Its serial read back on the open that asked, once the text is in: // another client's exec meanwhile can never send it into that // client's pane. |
