diff options
| author | Gabriel Schneider <[email protected]> | 2026-11-06 12:14:58 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-11-06 14:56:36 -0300 |
| commit | 4839c4b037d401393bbc87143d663e115c71242e (patch) | |
| tree | 6d23e1cd9aaf89404dd53f03e6ada23588b42dcc /src/upgrade.zig | |
| parent | 77671575bd2f481651ea54e956ac5c7da8d63710 (diff) | |
| download | pardes-4839c4b037d401393bbc87143d663e115c71242e.tar.gz pardes-4839c4b037d401393bbc87143d663e115c71242e.zip | |
idioms #2, formats that cannot overflow say so: a bufPrint or a fixed writer whose buffer provably holds the text (numbers, a 128-byte name, a short phrase) is catch unreachable with its reason, not a catch "" or a stand-in sentence nobody can reach, and dump.check takes its 256-byte why as such
Co-Authored-By: Claude Fable 5.1 <[email protected]>
Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge
Diffstat (limited to 'src/upgrade.zig')
| -rw-r--r-- | src/upgrade.zig | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/upgrade.zig b/src/upgrade.zig index 97d3be4f..626751ff 100644 --- a/src/upgrade.zig +++ b/src/upgrade.zig @@ -289,9 +289,9 @@ pub fn check(path: [:0]const u8, buf: []u8) Checked { else if (libc.W.IFEXITED(s) and libc.W.EXITSTATUS(s) == 127) "would not start" else if (libc.W.IFEXITED(s) and libc.W.EXITSTATUS(s) != 0) - std.fmt.bufPrint(&tail, "exited {d} at --version", .{libc.W.EXITSTATUS(s)}) catch "failed at --version" + std.fmt.bufPrint(&tail, "exited {d} at --version", .{libc.W.EXITSTATUS(s)}) catch unreachable // fits 96 else if (libc.W.IFSIGNALED(s)) - std.fmt.bufPrint(&tail, "died of signal {d} at --version", .{libc.W.TERMSIG(s)}) catch "died at --version" + std.fmt.bufPrint(&tail, "died of signal {d} at --version", .{libc.W.TERMSIG(s)}) catch unreachable // fits 96 else "does not answer --version as a pardes does"; return .{ .no = std.fmt.bufPrint(buf, "Upgrade: {s} {s}; this session stays as it is", .{ path[0..@min(path.len, 400)], how }) catch "Upgrade: the new pardes would not start; this session stays as it is" }; |
