From 3c33883d0227a7a67e22e777ea0b991285745667 Mon Sep 17 00:00:00 2001 From: marco Date: Mon, 19 Sep 2011 23:18:24 -0500 Subject: [PATCH] more clang warnings that are usesul --- scrotwm.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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 " -- 1.7.10.4