From: marco Date: Tue, 20 Sep 2011 04:18:24 +0000 (-0500) Subject: more clang warnings that are usesul X-Git-Url: https://jasonwoof.com/gitweb/?a=commitdiff_plain;h=3c33883d0227a7a67e22e777ea0b991285745667;p=spectrwm.git more clang warnings that are usesul --- 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 "