mirror of
https://github.com/ziglang/zig.git
synced 2025-12-06 14:23:09 +00:00
freebsd: getFdPath: handle NameTooLong
This commit is contained in:
parent
537624734c
commit
bd071c98a5
@ -5140,6 +5140,7 @@ pub fn getFdPath(fd: fd_t, out_buffer: *[MAX_PATH_BYTES]u8) RealPathError![]u8 {
|
||||
else => |err| return unexpectedErrno(err),
|
||||
}
|
||||
const len = mem.indexOfScalar(u8, &kfile.path, 0) orelse MAX_PATH_BYTES;
|
||||
if (len == 0) return error.NameTooLong;
|
||||
mem.copy(u8, out_buffer, kfile.path[0..len]);
|
||||
return out_buffer[0..len];
|
||||
} else {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user