From: Ari Johnson Date: Wed, 15 Dec 2010 05:13:17 +0000 (+0000) Subject: Fix for extraneous program() error messages X-Git-Url: https://git.theari.com/?a=commitdiff_plain;h=126c5f9c6386b1e443ee717dd34ddcacfff567e5;p=cobramush.git Fix for extraneous program() error messages --- 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;