Fix read_reg_string which was using the wrong size in bytes for the resulting buffer

This commit is contained in:
gingerBill
2026-04-02 10:25:19 +01:00
parent 69606e4e22
commit 70c4f4bc45

View File

@@ -366,7 +366,7 @@ read_reg_string :: proc "contextless" (hkey: sys.HKEY, subkey, val: cstring16, r
return
}
utf16.decode_to_utf8(res_buf[:result_size], buf_utf16[:])
utf16.decode_to_utf8(res_buf[:], buf_utf16[:result_size / size_of(u16)])
res = string(cstring(&res_buf[0]))
return res, true
}