fix crashing when barpadding is too high

This commit is contained in:
speedie 2022-12-17 17:35:55 +01:00
parent db0f9a8a4d
commit a8a0894ec0

View file

@ -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;