mirror of
https://github.com/Ed94/Odin.git
synced 2026-08-06 23:58:50 +00:00
Make the utf16 conversion procedures in core:sys/windows safer by checking for memory leaks
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user