diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-19 21:06:49 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-19 21:09:53 -0400 |
commit | 49ab1b91e7cccb4fc5edad6d2fa8c547fb38942b (patch) | |
tree | d8df645e9f993a6903dda09fdf5d24c45680850b /src/nvim/eval.c | |
parent | 003cda23123e98824ccc8f7467cf6800a8e75961 (diff) | |
download | rneovim-49ab1b91e7cccb4fc5edad6d2fa8c547fb38942b.tar.gz rneovim-49ab1b91e7cccb4fc5edad6d2fa8c547fb38942b.tar.bz2 rneovim-49ab1b91e7cccb4fc5edad6d2fa8c547fb38942b.zip |
Remove '- 1' for sizes passed to xstrlcpy
xstrlcpy() NUL-terminates the destination string
such that reducing the destination string length by 1
to reserve the last byte for NUL is pointless.
https://github.com/neovim/neovim/pull/14490#discussion_r635661185
Diffstat (limited to 'src/nvim/eval.c')
-rw-r--r-- | src/nvim/eval.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/nvim/eval.c b/src/nvim/eval.c index 04a9abe41a..1c981d65e0 100644 --- a/src/nvim/eval.c +++ b/src/nvim/eval.c @@ -1619,7 +1619,7 @@ void list_hashtable_vars(hashtab_T *ht, const char *prefix, int empty, char buf[IOSIZE]; // apply :filter /pat/ to variable name - xstrlcpy(buf, prefix, IOSIZE - 1); + xstrlcpy(buf, prefix, IOSIZE); xstrlcat(buf, (char *)di->di_key, IOSIZE); if (message_filtered((char_u *)buf)) { continue; |