summaryrefslogtreecommitdiff
path: root/function.c
diff options
context:
space:
mode:
Diffstat (limited to 'function.c')
-rw-r--r--function.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/function.c b/function.c
index 66d23fd..c2bd16f 100644
--- a/function.c
+++ b/function.c
@@ -771,6 +771,10 @@ func_wordlist (char *o, char **argv, const char *funcname UNUSED)
_("non-numeric second argument to `wordlist' function"));
start = atoi (argv[0]);
+ if (start < 1)
+ fatal (reading_file, "invalid first argument to `wordlist' function: '%d'",
+ message, start);
+
count = atoi (argv[1]) - start + 1;
if (count > 0)