summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/plugins/trigger/trigger-command.c3
-rw-r--r--src/plugins/trigger/trigger.c6
2 files changed, 4 insertions, 5 deletions
diff --git a/src/plugins/trigger/trigger-command.c b/src/plugins/trigger/trigger-command.c
index 315757f9d..4a6e5e1a8 100644
--- a/src/plugins/trigger/trigger-command.c
+++ b/src/plugins/trigger/trigger-command.c
@@ -915,8 +915,7 @@ trigger_command_init ()
" command: command (required), description, arguments, "
"description of arguments, completion\n"
" command_run: command (required)\n"
- " timer: interval (required), align on second (required), "
- "max calls (required)\n"
+ " timer: interval (required), align on second, max calls\n"
" config: name of option (required)\n"
" focus: name(s) of area (required)\n"
" conditions: evaluated conditions for the trigger\n"
diff --git a/src/plugins/trigger/trigger.c b/src/plugins/trigger/trigger.c
index 4a580469a..d74c2dda4 100644
--- a/src/plugins/trigger/trigger.c
+++ b/src/plugins/trigger/trigger.c
@@ -365,14 +365,14 @@ trigger_hook (struct t_trigger *trigger)
}
break;
case TRIGGER_HOOK_TIMER:
- if (argv && (argc >= 3))
+ if (argv && (argc >= 1))
{
error1 = NULL;
error2 = NULL;
error3 = NULL;
interval = strtol (argv[0], &error1, 10);
- align_second = strtol (argv[1], &error2, 10);
- max_calls = strtol (argv[2], &error3, 10);
+ align_second = strtol ((argc >= 2) ? argv[1] : "0", &error2, 10);
+ max_calls = strtol ((argc >= 3) ? argv[2] : "0", &error3, 10);
if (error1 && !error1[0]
&& error2 && !error2[0]
&& error3 && !error3[0]