mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 14:05:45 +02:00
status2d: Minor protection against crashes due to invalid x and y values
This commit is contained in:
parent
7b2c30b371
commit
e7ea06a0c2
@ -108,6 +108,11 @@ drawstatusbar(Monitor *m, int bh, char* stext, int stw, int stp)
|
||||
while (text[++i] != ',');
|
||||
int rh = atoi(text + ++i);
|
||||
|
||||
if (ry < 0)
|
||||
ry = 0;
|
||||
if (rx < 0)
|
||||
rx = 0;
|
||||
|
||||
drw_rect(drw, rx + x, ry, rw, rh, 1, 0);
|
||||
} else if (text[i] == 'f') {
|
||||
x += atoi(text + ++i);
|
||||
|
Loading…
Reference in New Issue
Block a user