diff options
| author | Anselm R. Garbe <arg@suckless.org> | 2007-03-29 15:17:57 +0200 |
|---|---|---|
| committer | Anselm R. Garbe <arg@suckless.org> | 2007-03-29 15:17:57 +0200 |
| commit | 06f9f346e650dfa2439836f3b01c8d1b242c2aee (patch) | |
| tree | dac444867330eb0c23bb2d078d441796b0f167da /client.c | |
| parent | Added tag 3.8 for changeset 2ea201354cf0 (diff) | |
| download | dwm-06f9f346e650dfa2439836f3b01c8d1b242c2aee.tar.gz dwm-06f9f346e650dfa2439836f3b01c8d1b242c2aee.zip | |
add an additional check in resize() to prevent a crash of dwm
Diffstat (limited to '')
| -rw-r--r-- | client.c | 4 |
1 files changed, 3 insertions, 1 deletions
| @@ -233,7 +233,7 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { | |||
| 233 | if(w <= 0 || h <= 0) | 233 | if(w <= 0 || h <= 0) |
| 234 | return; | 234 | return; |
| 235 | if(sizehints) { | 235 | if(sizehints) { |
| 236 | if(c->minay > 0 && c->maxay && (h - c->baseh) > 0) { | 236 | if(c->minay > 0 && c->maxay > 0 && (h - c->baseh) > 0) { |
| 237 | dx = (float)(w - c->basew); | 237 | dx = (float)(w - c->basew); |
| 238 | dy = (float)(h - c->baseh); | 238 | dy = (float)(h - c->baseh); |
| 239 | min = (float)(c->minax) / (float)(c->minay); | 239 | min = (float)(c->minax) / (float)(c->minay); |
| @@ -267,6 +267,8 @@ resize(Client *c, int x, int y, int w, int h, Bool sizehints) { | |||
| 267 | if(c->inch) | 267 | if(c->inch) |
| 268 | h -= (h - c->baseh) % c->inch; | 268 | h -= (h - c->baseh) % c->inch; |
| 269 | } | 269 | } |
| 270 | if(w <= 0 || h <= 0) | ||
| 271 | return; | ||
| 270 | if(w == sw && h == sh) | 272 | if(w == sw && h == sh) |
| 271 | c->border = 0; | 273 | c->border = 0; |
| 272 | else | 274 | else |
