ref: 4af7932f22831bfcce8c3978d7645b0dd0657cf4
parent: 672d5e851767118476de79e6204d70361b1b6823
author: cinap_lenrek <cinap_lenrek@felloff.net>
date: Tue Nov 19 04:03:45 EST 2019
rio: fix cons read breakage from previous commit
--- a/sys/src/cmd/rio/wind.c
+++ b/sys/src/cmd/rio/wind.c
@@ -406,7 +406,7 @@
t = "notcurrent";
if(w == input)
t = "current";
- pair.ns = snprint(pair.s, pair.ns, "%11d %11d %11d %11d %11s %11s ",
+ pair.ns = snprint(pair.s, pair.ns+1, "%11d %11d %11d %11d %11s %11s ",
w->i->r.min.x, w->i->r.min.y, w->i->r.max.x, w->i->r.max.y, t, s);
send(crm.c2, &pair);
continue;
--- a/sys/src/cmd/rio/xfid.c
+++ b/sys/src/cmd/rio/xfid.c
@@ -670,9 +670,9 @@
}
c1 = crm.c1;
c2 = crm.c2;
- pair.ns = cnt+UTFmax+1; /* room for partial rune and null byte */
- t = emalloc(pair.ns);
+ t = emalloc(cnt+UTFmax+1); /* room to unpack partial rune plus */
pair.s = t;
+ pair.ns = cnt;
send(c1, &pair);
recv(c2, &pair);
fc.data = pair.s;
--
⑨