diff options
author | mischief <mischief@offblast.org> | 2014-01-08 20:52:40 -0800 |
---|---|---|
committer | mischief <mischief@offblast.org> | 2014-01-08 20:52:40 -0800 |
commit | 8319457a10fd0bbd61866c56f5e5af4521d28fe8 (patch) | |
tree | 4763dc477cd9a3ceea337080c98958d283e109ae /sys/src/cmd/winwatch.c | |
parent | ce2487c3ccbad19322a38783e5af0ea398fc4243 (diff) |
winwatch: prevent divide by zero if the window height is too small
Diffstat (limited to 'sys/src/cmd/winwatch.c')
-rw-r--r-- | sys/src/cmd/winwatch.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/sys/src/cmd/winwatch.c b/sys/src/cmd/winwatch.c index 089dd1536..f2d8fefd1 100644 --- a/sys/src/cmd/winwatch.c +++ b/sys/src/cmd/winwatch.c @@ -188,6 +188,8 @@ geometry(void) 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){ |