shithub: riscv

Download patch

ref: 8319457a10fd0bbd61866c56f5e5af4521d28fe8
parent: ce2487c3ccbad19322a38783e5af0ea398fc4243
author: mischief <mischief@offblast.org>
date: Wed Jan 8 15:52:40 EST 2014

winwatch: prevent divide by zero if the window height is too small

--- a/sys/src/cmd/winwatch.c
+++ b/sys/src/cmd/winwatch.c
@@ -188,6 +188,8 @@
 
 	z = 0;
 	rows = (Dy(screen->r)-2*MARGIN+PAD)/(font->height+PAD);
+	if(rows == 0)
+		rows = 1;
 	if(rows*cols < nwin || rows*cols >= nwin*2){
 		ncols = nwin <= 0 ? 1 : (nwin+rows-1)/rows;
 		if(ncols != cols){
--