Make the utf16 conversion procedures in core:sys/windows safer by checking for memory leaks

This commit is contained in:
gingerBill
2022-05-12 13:17:58 +01:00
parent bb4f108487
commit eef44b11f3
17 changed files with 105 additions and 72 deletions
+9 -1
View File
@@ -2,12 +2,20 @@ package os2
import "core:io"
file_to_stream :: proc(f: ^File) -> (s: io.Stream) {
to_stream :: proc(f: ^File) -> (s: io.Stream) {
s.stream_data = f
s.stream_vtable = _file_stream_vtable
return
}
to_writer :: proc(f: ^File) -> (s: io.Writer) {
return {to_stream(f)}
}
to_reader :: proc(f: ^File) -> (s: io.Reader) {
return {to_stream(f)}
}
@(private)
error_to_io_error :: proc(ferr: Error) -> io.Error {
if ferr == nil {