[awesome-message] Check that delay is an integer greater than 0

Signed-off-by: Julien Danjou <julien@danjou.info>
This commit is contained in:
Julien Danjou 2008-03-23 20:25:21 +01:00
parent d07ca5f76d
commit 4e73492bee
2 changed files with 3 additions and 2 deletions

View File

@ -30,7 +30,7 @@ OPTIONS
-y ycoord:: -y ycoord::
Set y coordinate of the window. Set y coordinate of the window.
-d delay:: -d delay::
Close the window after <delay> seconds. Close the window after <delay> seconds. Must be an integer greater than 0.
<message>:: <message>::
Print this message in the window. Print this message in the window.
<icon>:: <icon>::

View File

@ -144,7 +144,8 @@ main(int argc, char **argv)
switch(opt) switch(opt)
{ {
case 'd': case 'd':
delay = atoi(optarg); if((delay = atoi(optarg)) <= 0)
delay = 1;
break; break;
case 'v': case 'v':
eprint_version(PROGNAME); eprint_version(PROGNAME);