diff --git a/vlib/os/file_le_be.c.v b/vlib/os/file_le_be.c.v index 1760060b1d..6b746c5a36 100644 --- a/vlib/os/file_le_be.c.v +++ b/vlib/os/file_le_be.c.v @@ -57,13 +57,17 @@ pub fn (mut f File) read_be[T]() !T { // write_u8 writes a single byte value to the file `f`. // Note: if possible, use some of the other APIs, that write larger chunks of data, before using write_u8/1. pub fn (mut f File) write_u8(b u8) ! { - return f.write_le[u8](b) + C.errno = 0 // needed for tcc + check_fwrite(C.fwrite(voidptr(&b), 1, 1, f.cfile))! } // read_u8 reads a single byte value from the file `f`. // Note: if possible, use some of the other APIs, that read larger chunks of data, before using read_u8/1. pub fn (mut f File) read_u8() !u8 { - return f.read_le[u8]() + mut res := u8(0) + C.errno = 0 // needed for tcc + check_fread(C.fread(voidptr(&res), 1, 1, f.cfile))! + return res } // private helpers