summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2011-07-15 18:02:33 -0700
committerAlan Coopersmith <alan.coopersmith@oracle.com>2011-07-18 17:13:24 -0700
commit8093ecf2ecd112914b9399bab0c413369c9057ca (patch)
tree17d69361084dde1d19fa0847a8b745e4cc1cc2cc
parent03050fcce76cd3238f1cd15fb2f2298abda53727 (diff)
Give better error for "xset dpms force" without argument
Changes from "xset: unknown option force" to "xset: missing argument to dpms force" Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
-rw-r--r--xset.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/xset.c b/xset.c
index f41dbb5..7703618 100644
--- a/xset.c
+++ b/xset.c
@@ -555,8 +555,9 @@ main(int argc, char *argv[])
DPMSEnable(dpy);
DPMSSetTimeouts(dpy, standby_timeout, suspend_timeout,
off_timeout);
- } else if (i + 1 < argc && strcmp(arg, "force") == 0) {
- i++;
+ } else if (strcmp(arg, "force") == 0) {
+ if (++i >= argc)
+ usage("missing argument to dpms force", NULL);
arg = argv[i];
/*
* The calls to usleep below are necessary to