diff options
| author | Andrew Kelley <andrew@ziglang.org> | 2025-12-26 14:11:30 -0800 |
|---|---|---|
| committer | Andrew Kelley <andrew@ziglang.org> | 2025-12-26 19:58:56 -0800 |
| commit | 2e9415d8a0645adbfcce6e9dc7f6bbf6be233b6f (patch) | |
| tree | 216ae8f85823cd7fc34f22bfd4442d5c25925761 | |
| parent | 0dbcf97551765d3abbaea5fb0b9e94e5e0be1b14 (diff) | |
| download | zig-2e9415d8a0645adbfcce6e9dc7f6bbf6be233b6f.tar.gz zig-2e9415d8a0645adbfcce6e9dc7f6bbf6be233b6f.zip | |
std.Io.Threaded: fix missing `@memcpy` in realPathPosix for FreeBSD
| -rw-r--r-- | lib/std/Io/Threaded.zig | 1 | ||||
| -rw-r--r-- | lib/std/c/freebsd.zig | 2 |
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); |
