authorgravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-30 21:55:29 -07:00
committergravatar for hello@nektro.netMeghan Denny <hello@nektro.net> 2026-05-30 21:55:29 -07:00
log7c161d74c77ef9d482bb71273163fd454674240b
treefad8cb5eccc2f6a216bc945c87c8b52edca3c267
parentaaea5467f1a8b4c2ce7129ee7bc6bf2e11544167
signaturebadge-check Signed by SSH key SHA256:4hHJbtBRU58AYXwjL7fkz2fnQHdiye8x1QpTCQ0sHNw

readlinkat: ensure result is nul-terminated


1 files changed, 1 insertions(+), 0 deletions(-)

mod.zig+1
...@@ -3466,6 +3466,7 @@ pub fn readlinkat(dirfd: c_int, noalias path: [*:0]const u8, noalias buf: []u8)...@@ -3466,6 +3466,7 @@ pub fn readlinkat(dirfd: c_int, noalias path: [*:0]const u8, noalias buf: []u8)
3466 const rc = libc.readlinkat(dirfd, path, buf.ptr, buf.len);3466 const rc = libc.readlinkat(dirfd, path, buf.ptr, buf.len);
3467 if (rc == -1) return errno.fromInt(errno.fromLibC());3467 if (rc == -1) return errno.fromInt(errno.fromLibC());
3468 std.debug.assert(rc >= 0);3468 std.debug.assert(rc >= 0);
3469 buf[@intCast(rc)] = 0;
3469 return buf[0..@intCast(rc) :0];3470 return buf[0..@intCast(rc) :0];
3470}3471}
3471pub fn write(fd: c_int, buf: []const u8) !usize {3472pub fn write(fd: c_int, buf: []const u8) !usize {