ref: 62375ca259df19a32b791ab67256e24a5c75c1db
parent: 95034f67da8b6e6dca03868002ea2c56bad49b7c
author: Ori Bernstein <ori@eigenstate.org>
date: Sat Jun 20 06:17:52 EDT 2015
Fix bio.put() We passed a valist to a variadic function; oops.
--- a/libbio/bio.myr
+++ b/libbio/bio.myr
@@ -92,7 +92,7 @@
the requested mode, with the requested permissions
*/
const create = {path, mode, perm
- -> sysopen(path, mode, sysmode(mode) | std.Ocreat, perm)
+ -> sysopen(path, mode, sysmode(mode) | std.Ocreat | std.Otrunc, perm)
}
/* dial the server, and open a file using the returned fd */
@@ -403,11 +403,10 @@
we're stuck with a small static buffer.
*/
const put = {f, fmt, args
- var sb, sl, ap, n
+ var sl, ap, n
ap = std.vastart(&args)
- sb = std.mksb()
- sl = std.fmt(fmt, &ap)
+ sl = std.fmtv(fmt, &ap)
n = write(f, sl)
std.slfree(sl)
-> n