1
0
forked from aniani/vim

patch 7.4.1075

Problem:    Crash when using an invalid command.
Solution:   Fix generating the error message. (Dominique Pelle)
This commit is contained in:
Bram Moolenaar
2016-01-10 13:54:48 +01:00
parent 5fa4d448fb
commit 05fe017c1a
2 changed files with 6 additions and 1 deletions

View File

@@ -6916,6 +6916,7 @@ parse_addr_type_arg(value, vallen, argt, addr_type_arg)
int *addr_type_arg;
{
int i, a, b;
for (i = 0; addr_type_complete[i].expand != -1; ++i)
{
a = (int)STRLEN(addr_type_complete[i].name) == vallen;
@@ -6930,7 +6931,9 @@ parse_addr_type_arg(value, vallen, argt, addr_type_arg)
if (addr_type_complete[i].expand == -1)
{
char_u *err = value;
for (i=0; err[i] == NUL || !vim_iswhite(err[i]); i++);
for (i = 0; err[i] != NUL && !vim_iswhite(err[i]); i++)
;
err[i] = NUL;
EMSG2(_("E180: Invalid address type value: %s"), err);
return FAIL;