os: fix file.writeln(s) too, where s contains `0` bytes

pull/5656/head
Delyan Angelov 2020-07-04 14:10:22 +03:00
parent 3b067f5f85
commit bae9ed0350
1 changed files with 1 additions and 1 deletions

View File

@ -56,7 +56,7 @@ pub fn (mut f File) writeln(s string) {
}
*/
// TODO perf
C.fputs(s.str, f.cfile)
C.fwrite(s.str, s.len, 1, f.cfile)
C.fputs('\n', f.cfile)
}