fix crashing when barpadding is too high
This commit is contained in:
parent
db0f9a8a4d
commit
a8a0894ec0
16
speedwm.c
16
speedwm.c
|
@ -3108,8 +3108,15 @@ void
|
|||
setbarpaddingv(const Arg *arg)
|
||||
{
|
||||
Bar *bar;
|
||||
|
||||
vp += arg->i;
|
||||
|
||||
/* set a max of 100 */
|
||||
if (vp >= 100) {
|
||||
vp -= arg->i;
|
||||
return;
|
||||
}
|
||||
|
||||
/* prevent bar weirdness */
|
||||
if (vp < 0) {
|
||||
vp = 0;
|
||||
|
@ -3127,8 +3134,15 @@ void
|
|||
setbarpaddingh(const Arg *arg)
|
||||
{
|
||||
Bar *bar;
|
||||
|
||||
sp += arg->i;
|
||||
|
||||
|
||||
/* set a max of 100 */
|
||||
if (sp > 100) {
|
||||
sp -= arg->i;
|
||||
return;
|
||||
}
|
||||
|
||||
/* prevent bar weirdness */
|
||||
if (sp < 0) {
|
||||
sp = 0;
|
||||
|
|
Loading…
Reference in a new issue