aboutsummaryrefslogtreecommitdiff
path: root/lib/std
diff options
context:
space:
mode:
authorAndrew Kelley <andrew@ziglang.org>2025-12-26 14:11:30 -0800
committerAndrew Kelley <andrew@ziglang.org>2025-12-26 19:58:56 -0800
commit2e9415d8a0645adbfcce6e9dc7f6bbf6be233b6f (patch)
tree216ae8f85823cd7fc34f22bfd4442d5c25925761 /lib/std
parent0dbcf97551765d3abbaea5fb0b9e94e5e0be1b14 (diff)
downloadzig-2e9415d8a0645adbfcce6e9dc7f6bbf6be233b6f.tar.gz
zig-2e9415d8a0645adbfcce6e9dc7f6bbf6be233b6f.zip
std.Io.Threaded: fix missing `@memcpy` in realPathPosix for FreeBSD
Diffstat (limited to 'lib/std')
-rw-r--r--lib/std/Io/Threaded.zig1
-rw-r--r--lib/std/c/freebsd.zig2
2 files changed, 2 insertions, 1 deletions
diff --git a/lib/std/Io/Threaded.zig b/lib/std/Io/Threaded.zig
index bf1bfc00ef..18ee2c9206 100644
--- a/lib/std/Io/Threaded.zig
+++ b/lib/std/Io/Threaded.zig
@@ -4302,6 +4302,7 @@ fn realPathPosix(current_thread: *Thread, fd: posix.fd_t, out_buffer: []u8) File
}
const len = std.mem.findScalar(u8, &k_file.path, 0) orelse k_file.path.len;
if (len == 0) return error.NameTooLong;
+ @memcpy(out_buffer[0..len], k_file.path[0..len]);
return len;
},
else => return error.OperationUnsupported,
diff --git a/lib/std/c/freebsd.zig b/lib/std/c/freebsd.zig
index 45ad812ed1..ad67b23a14 100644
--- a/lib/std/c/freebsd.zig
+++ b/lib/std/c/freebsd.zig
@@ -250,7 +250,7 @@ pub const kinfo_file = extern struct {
/// Reserved for future cap_rights
_cap_spare: u64,
/// Path to file, if any.
- path: [PATH_MAX - 1:0]u8,
+ path: [PATH_MAX]u8,
comptime {
assert(@sizeOf(@This()) == KINFO_FILE_SIZE);