From 06f9f346e650dfa2439836f3b01c8d1b242c2aee Mon Sep 17 00:00:00 2001 From: "Anselm R. Garbe" Date: Thu, 29 Mar 2007 15:17:57 +0200 Subject: add an additional check in resize() to prevent a crash of dwm --- client.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/client.c b/client.c index 1844713..282ad53 100644 --- a/client.c +++ b/client.c @@ -233,7 +233,7 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { if(w <= 0 || h <= 0) return; if(sizehints) { - if(c->minay > 0 && c->maxay && (h - c->baseh) > 0) { + if(c->minay > 0 && c->maxay > 0 && (h - c->baseh) > 0) { dx = (float)(w - c->basew); dy = (float)(h - c->baseh); min = (float)(c->minax) / (float)(c->minay); @@ -267,6 +267,8 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { if(c->inch) h -= (h - c->baseh) % c->inch; } + if(w <= 0 || h <= 0) + return; if(w == sw && h == sh) c->border = 0; else -- cgit v1.2.3-13-gbd6f