diff options
author | zeertzjq <zeertzjq@outlook.com> | 2022-09-29 16:04:14 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-09-29 16:04:14 +0800 |
commit | 45707c1eae62667e5c482a09f6d9a62e01db0e21 (patch) | |
tree | 63fb5841b35a53b2b991f29a738c002fea28efa7 /src/nvim/ex_docmd.c | |
parent | 1cf44d6f5794c7b6bd181dfb2ce51f5ff4381ee8 (diff) | |
download | rneovim-45707c1eae62667e5c482a09f6d9a62e01db0e21.tar.gz rneovim-45707c1eae62667e5c482a09f6d9a62e01db0e21.tar.bz2 rneovim-45707c1eae62667e5c482a09f6d9a62e01db0e21.zip |
fix(api): fix nvim_cmd crash with filename expansion (#20397)
Diffstat (limited to 'src/nvim/ex_docmd.c')
-rw-r--r-- | src/nvim/ex_docmd.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/ex_docmd.c b/src/nvim/ex_docmd.c index 96f98b92ca..386f708f79 100644 --- a/src/nvim/ex_docmd.c +++ b/src/nvim/ex_docmd.c @@ -3887,7 +3887,7 @@ static char *repl_cmdline(exarg_T *eap, char *src, size_t srclen, char *repl, ch } else { // Otherwise, argument gets shifted alongside the replaced text. // The amount of the shift is equal to the difference of the old and new string length. - eap->args[j] = new_cmdline + (eap->args[j] - *cmdlinep) + (len - srclen); + eap->args[j] = new_cmdline + ((eap->args[j] - *cmdlinep) + (ptrdiff_t)(len - srclen)); } } |