X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=scrotwm.c;h=4730a0f20143a61460ef0dce3034803e981c9464;hb=af1157519cecb67d3039e1861d99bf070f0cfba0;hp=c8fb2d2776249db364aa49486069ccb2bc3855a0;hpb=7207fd01c34fbad7030ccf404342f3a44796f1db;p=spectrwm.git diff --git a/scrotwm.c b/scrotwm.c index c8fb2d2..4730a0f 100644 --- a/scrotwm.c +++ b/scrotwm.c @@ -1166,8 +1166,8 @@ custom_region(char *val) if (w < 1 || h < 1) errx(1, "region %ux%u+%u+%u too small\n", w, h, x, y); - if (x < 0 || x > DisplayWidth(display, sidx) || - y < 0 || y > DisplayHeight(display, sidx) || + if (x > DisplayWidth(display, sidx) || + y > DisplayHeight(display, sidx) || w + x > DisplayWidth(display, sidx) || h + y > DisplayHeight(display, sidx)) { fprintf(stderr, "ignoring region %ux%u+%u+%u "