Browse Source

Improve fix.

Jeroen van Rijn 1 year ago
parent
commit
9ecc33570b
1 changed files with 1 additions and 4 deletions
  1. 1 4
      core/sys/windows/util.odin

+ 1 - 4
core/sys/windows/util.odin

@@ -54,10 +54,7 @@ utf8_to_utf16 :: proc(s: string, allocator := context.temp_allocator) -> []u16 {
 }
 }
 utf8_to_wstring :: proc(s: string, allocator := context.temp_allocator) -> wstring {
 utf8_to_wstring :: proc(s: string, allocator := context.temp_allocator) -> wstring {
 	if res := utf8_to_utf16(s, allocator); len(res) > 0 {
 	if res := utf8_to_utf16(s, allocator); len(res) > 0 {
-		return &res[0]
-	} else {
-		delete(res, allocator)
-		return nil
+		return raw_data(res)
 	}
 	}
 	return nil
 	return nil
 }
 }