os2 internals -> (c)string16

This commit is contained in:
gingerBill
2025-08-02 12:47:03 +01:00
parent 9b5700225d
commit c631a8eff5
10 changed files with 77 additions and 50 deletions
+2 -2
View File
@@ -12,12 +12,12 @@ _temp_dir :: proc(allocator: runtime.Allocator) -> (string, runtime.Allocator_Er
temp_allocator := TEMP_ALLOCATOR_GUARD({ allocator })
b := make([]u16, max(win32.MAX_PATH, n), temp_allocator)
n = win32.GetTempPathW(u32(len(b)), raw_data(b))
n = win32.GetTempPathW(u32(len(b)), cstring16(raw_data(b)))
if n == 3 && b[1] == ':' && b[2] == '\\' {
} else if n > 0 && b[n-1] == '\\' {
n -= 1
}
return win32_utf16_to_utf8(b[:n], allocator)
return win32_utf16_to_utf8(string16(b[:n]), allocator)
}