ref: 888c59c07e1f38659ca9aae9583b1ad84553fe06
parent: 1787a8b990236e27d4487ea5ea6e9623b7106b1d
parent: 95b9b8863d747698cfb27d92f6160a588703acf3
author: Ori Bernstein <[email protected]>
date: Tue Jan 5 14:48:26 EST 2021
merge
--- a/sys/src/cmd/qr.c
+++ b/sys/src/cmd/qr.c
@@ -732,8 +732,11 @@
b = qrcode(ver, lev, mode, buf, rc, &s);
if(b == nil)
sysfatal("%r");
- print("%11s %11d %11d %11d %11d ", "k8", 0, 0, s, s);
- write(1, b, s * s);
+ if(print("%11s %11d %11d %11d %11d ", "k8", 0, 0, s, s) != 5*12)
+ sysfatal("print: %r");
+ if(write(1, b, s*s) != s*s)
+ sysfatal("write: %r");
+ exits(0);
}
uchar qrrawpolys[] = {