diff options
author | Bram Moolenaar <Bram@vim.org> | 2016-01-10 13:54:48 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2016-01-10 13:54:48 +0100 |
commit | 05fe017c1ac0503b706dad695097572fde01ab0b (patch) | |
tree | 126e4cc32c671bb730a6326456dbd04ac2017eb2 /src/ex_docmd.c | |
parent | 5fa4d448fb717874b6619bcda62e42190702997c (diff) |
patch 7.4.1075v7.4.1075
Problem: Crash when using an invalid command.
Solution: Fix generating the error message. (Dominique Pelle)
Diffstat (limited to 'src/ex_docmd.c')
-rw-r--r-- | src/ex_docmd.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/ex_docmd.c b/src/ex_docmd.c index ac713dc13c..837d135218 100644 --- a/src/ex_docmd.c +++ b/src/ex_docmd.c @@ -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; |