os: fix early termination when saving binary (#5646)

pull/5647/head
div72 2020-07-04 02:48:01 +03:00 committed by GitHub
parent 37f31da6c9
commit 95696559b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 4 additions and 2 deletions

View File

@ -6,7 +6,9 @@ module http
import os import os
pub fn download_file(url, out string) bool { pub fn download_file(url, out string) bool {
$if debug_http? {
println('download file url=$url out=$out') println('download file url=$url out=$out')
}
s := get(url) or { s := get(url) or {
return false return false
} }

View File

@ -39,7 +39,7 @@ pub fn (mut f File) write(s string) {
} }
} }
*/ */
C.fputs(s.str, f.cfile) C.fwrite(s.str, s.len, 1, f.cfile)
} }
pub fn (mut f File) writeln(s string) { pub fn (mut f File) writeln(s string) {