From 126c5f9c6386b1e443ee717dd34ddcacfff567e5 Mon Sep 17 00:00:00 2001 From: Ari Johnson Date: Wed, 15 Dec 2010 05:13:17 +0000 Subject: [PATCH] Fix for extraneous program() error messages --- src/prog.c | 25 +++++++++++++++---------- 1 file changed, 15 insertions(+), 10 deletions(-) diff --git a/src/prog.c b/src/prog.c index 0714192..5c350ef 100644 --- a/src/prog.c +++ b/src/prog.c @@ -261,19 +261,24 @@ FUNCTION(fun_prog) safe_str("#-1 PERMISSION DENIED", buff, bp); return; } - if (args[3] && is_integer(args[3]) && atoi(args[3]) == 1) - pflags = PI_LOCK; - else { - do_rawlog(LT_ERR, - "Bad Program Prompt, Silently Ignored. HINT: Use Prompt() : %d - %s", - executor, global_eval_context.ccom); + if (nargs >= 4) { + if (args[3] && is_integer(args[3]) && atoi(args[3]) == 1) + pflags = PI_LOCK; + else { + do_rawlog(LT_ERR, + "Bad Program Prompt, Silently Ignored. HINT: Use Prompt() : %d - %s", + executor, global_eval_context.ccom); + } } - if (args[4] && atoi(args[4]) == 1) { - pflags = PI_LOCK; - do_rawlog(LT_ERR, "Bad Proglock Usage format used on %d - %s", - executor, global_eval_context.ccom); + if (nargs >= 5) { + if (args[4] && atoi(args[4]) == 1) { + pflags = PI_LOCK; + do_rawlog(LT_ERR, "Bad Proglock Usage format used on %d - %s", + executor, global_eval_context.ccom); + } } + /* Save Registers to XY_PROGENV */ memset(tbuf1, '\0', BUFFER_LEN); tbp = tbuf1; -- 2.30.2