Skip to content

Commit 36aaff7

Browse files
committed
Fix compilation error in realpathatW
1 parent e97d1e0 commit 36aaff7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

lib/std/os.zig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4088,7 +4088,7 @@ pub fn realpathatW(fd: fd_t, pathname: [*:0]const u16, out_buffer: *[MAX_PATH_BY
40884088

40894089
// Convert UTF16LE to UTF8
40904090
var pathname_u8: [MAX_PATH_BYTES]u8 = undefined;
4091-
const end_index = std.unicode.utf16leToUtf8(pathname_u8[0..], wide_slice[start_index..]) catch unreachable;
4091+
const end_index = std.unicode.utf16leToUtf8(pathname_u8[0..], mem.spanZ(pathname)) catch unreachable;
40924092
const total_len = fd_path.len + end_index + 1; // +1 to account for path separator
40934093
if (total_len >= MAX_PATH_BYTES) {
40944094
return error.NameTooLong;

0 commit comments

Comments
 (0)