diff options
| author | daurnimator <quae@daurnimator.com> | 2019-12-28 16:40:59 +1100 |
|---|---|---|
| committer | daurnimator <quae@daurnimator.com> | 2019-12-29 10:35:05 +1100 |
| commit | 2662e50d27006396a4b6c776dc757e883b836fcc (patch) | |
| tree | 7a2fbe1e5b5efff105d4194d7c32ae0af8aa71d0 /lib/std/os.zig | |
| parent | cb02125415b516b13824fe90aca19c6fc9203cda (diff) | |
| download | zig-2662e50d27006396a4b6c776dc757e883b836fcc.tar.gz zig-2662e50d27006396a4b6c776dc757e883b836fcc.zip | |
std: sentinel terminated pointers for utf16 apis
Diffstat (limited to 'lib/std/os.zig')
| -rw-r--r-- | lib/std/os.zig | 4 |
1 files changed, 1 insertions, 3 deletions
diff --git a/lib/std/os.zig b/lib/std/os.zig index 3cc43357bd..ebb9489de3 100644 --- a/lib/std/os.zig +++ b/lib/std/os.zig @@ -2634,9 +2634,7 @@ pub fn realpathW(pathname: [*:0]const u16, out_buffer: *[MAX_PATH_BYTES]u8) Real defer windows.CloseHandle(h_file); var wide_buf: [windows.PATH_MAX_WIDE]u16 = undefined; - const wide_len = try windows.GetFinalPathNameByHandleW(h_file, &wide_buf, wide_buf.len, windows.VOLUME_NAME_DOS); - assert(wide_len <= wide_buf.len); - const wide_slice = wide_buf[0..wide_len]; + const wide_slice = try windows.GetFinalPathNameByHandleW(h_file, &wide_buf, wide_buf.len, windows.VOLUME_NAME_DOS); // Windows returns \\?\ prepended to the path. // We strip it to make this function consistent across platforms. |
