diff -Nru /n/sources/plan9/sys/src/libmemdraw/write.c /sys/src/libmemdraw/write.c --- /n/sources/plan9/sys/src/libmemdraw/write.c Thu Feb 28 21:03:37 2002 +++ /sys/src/libmemdraw/write.c Sun Nov 6 00:00:00 2016 @@ -64,7 +64,7 @@ if(nb != dy*bpl) goto ErrOut; } - sprint(hdr, "compressed\n%11s %11d %11d %11d %11d ", + snprint(hdr, sizeof hdr, "compressed\n%11s %11d %11d %11d %11d ", chantostr(cbuf, i->chan), r.min.x, r.min.y, r.max.x, r.max.y); if(write(fd, hdr, 11+5*12) != 11+5*12) goto ErrOut; @@ -170,7 +170,7 @@ if(loutp == outbuf) goto ErrOut; n = loutp-outbuf; - sprint(hdr, "%11d %11ld ", r.max.y, n); + snprint(hdr, sizeof hdr, "%11d %11ld ", r.max.y, n); write(fd, hdr, 2*12); write(fd, outbuf, n); r.min.y = r.max.y;