From 4e73492beef233968c5839586fcf33abe4b09af3 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sun, 23 Mar 2008 20:25:21 +0100 Subject: [PATCH] [awesome-message] Check that delay is an integer greater than 0 Signed-off-by: Julien Danjou --- awesome-message.1.txt | 2 +- awesome-message.c | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/awesome-message.1.txt b/awesome-message.1.txt index efe83404c..f50101e7f 100644 --- a/awesome-message.1.txt +++ b/awesome-message.1.txt @@ -30,7 +30,7 @@ OPTIONS -y ycoord:: Set y coordinate of the window. -d delay:: - Close the window after seconds. + Close the window after seconds. Must be an integer greater than 0. :: Print this message in the window. :: diff --git a/awesome-message.c b/awesome-message.c index a84d0ea9c..b68bdd30d 100644 --- a/awesome-message.c +++ b/awesome-message.c @@ -144,7 +144,8 @@ main(int argc, char **argv) switch(opt) { case 'd': - delay = atoi(optarg); + if((delay = atoi(optarg)) <= 0) + delay = 1; break; case 'v': eprint_version(PROGNAME);