all repos — dwm @ 06f9f346e650dfa2439836f3b01c8d1b242c2aee

my dwm build

add an additional check in resize() to prevent a crash of dwm
Anselm R. Garbe arg@suckless.org
Thu, 29 Mar 2007 15:17:57 +0200
commit

06f9f346e650dfa2439836f3b01c8d1b242c2aee

parent

5c48012ad25de8eb97818de9bff7c7021f5fe52f

1 files changed, 3 insertions(+), 1 deletions(-)

jump to
M client.cclient.c

@@ -233,7 +233,7 @@

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 @@ w -= (w - c->basew) % c->incw;

if(c->inch) h -= (h - c->baseh) % c->inch; } + if(w <= 0 || h <= 0) + return; if(w == sw && h == sh) c->border = 0; else