summaryrefslogtreecommitdiff
path: root/src/userfunc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/userfunc.c')
-rw-r--r--src/userfunc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/src/userfunc.c b/src/userfunc.c
index ea1542385..9ffafc371 100644
--- a/src/userfunc.c
+++ b/src/userfunc.c
@@ -150,7 +150,9 @@ func_init()
hash_init(&func_hashtab);
}
-/* Get function arguments. */
+/*
+ * Get function arguments.
+ */
static int
get_function_args(
char_u **argp,
@@ -232,7 +234,9 @@ get_function_args(
break;
}
}
- ++p; /* skip the ')' */
+ if (*p != endchar)
+ goto err_ret;
+ ++p; /* skip "endchar" */
*argp = p;
return OK;