From dde4979f59bec754b7909a81a40763850f3c29c0 Mon Sep 17 00:00:00 2001 From: Gabriel Schneider Date: Fri, 6 Nov 2026 12:38:55 -0300 Subject: idioms #5, more formats that cannot overflow: /proc paths of a pid, the daemon's pty, close and clients words, a pid or a serial for the environment, a capture's header and status line and a cache's .new name are catch unreachable with their reason, where a catch return, null or continue stood for an overflow no buffer here can have Co-Authored-By: Claude Fable 5.1 Claude-Session: https://claude.ai/code/session_016Y9MNAtZenFv4weoMD3cge --- src/9p_io.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/9p_io.zig') diff --git a/src/9p_io.zig b/src/9p_io.zig index 10109bb8..bc122109 100644 --- a/src/9p_io.zig +++ b/src/9p_io.zig @@ -1737,7 +1737,7 @@ pub fn exportEnv(serial: u32, adopts: bool) void { const socket: ?[]const u8 = if (own_socket_len > 0) own_socket[0..own_socket_len] else null; const ChildEnv = @import("host_io.zig").ChildEnv; var pid_buf: [16]u8 = undefined; - ChildEnv.exportVar("PARDES_PID", if (adopts) std.fmt.bufPrint(&pid_buf, "{d}", .{@as(u32, @intCast(libc.getpid()))}) catch null else null); + ChildEnv.exportVar("PARDES_PID", if (adopts) std.fmt.bufPrint(&pid_buf, "{d}", .{@as(u32, @intCast(libc.getpid()))}) catch unreachable else null); // a u32 fits 16 if (socket) |own| { var buf: [16]u8 = undefined; ChildEnv.exportVar("PARDES_9P", own); -- cgit v1.3