diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-08-18 23:26:08 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2020-08-18 23:34:13 -0400 |
commit | 8d6c1edc6e31d202590082fa58bf042926e696b2 (patch) | |
tree | d56e479bc805cd77bee44a2a0c6f4a0bab56a4de /src | |
parent | 45615cedd10fb5dc3c502815ed4d98b6d4e4488a (diff) | |
download | rneovim-8d6c1edc6e31d202590082fa58bf042926e696b2.tar.gz rneovim-8d6c1edc6e31d202590082fa58bf042926e696b2.tar.bz2 rneovim-8d6c1edc6e31d202590082fa58bf042926e696b2.zip |
vim-patch:8.1.2267: compiler warning for uninitialized variable
Problem: Compiler warning for uninitialized variable. (Tony Mechelynck)
Solution: Rearrange the code.
https://github.com/vim/vim/commit/3b991527e8167f25ad1dfe780b9633c153600955
Diffstat (limited to 'src')
-rw-r--r-- | src/nvim/buffer.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/src/nvim/buffer.c b/src/nvim/buffer.c index b3bbdce9d9..4648631ebe 100644 --- a/src/nvim/buffer.c +++ b/src/nvim/buffer.c @@ -2650,7 +2650,7 @@ void buflist_list(exarg_T *eap) int i; garray_T buflist; - buf_T **buflist_data = NULL, **p; + buf_T **buflist_data = NULL; if (vim_strchr(eap->arg, 't')) { ga_init(&buflist, sizeof(buf_T *), 50); @@ -2662,13 +2662,14 @@ void buflist_list(exarg_T *eap) qsort(buflist.ga_data, (size_t)buflist.ga_len, sizeof(buf_T *), buf_time_compare); - p = buflist_data = (buf_T **)buflist.ga_data; - buf = *p; + buflist_data = (buf_T **)buflist.ga_data; + buf = *buflist_data; } + buf_T **p = buflist_data; for (; buf != NULL && !got_int; - buf = buflist_data + buf = buflist_data != NULL ? (++p < buflist_data + buflist.ga_len ? *p : NULL) : buf->b_next) { const bool is_terminal = buf->terminal; |