summaryrefslogtreecommitdiffstats
path: root/src/buffer.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-11-06 23:26:20 +0100
committerBram Moolenaar <Bram@vim.org>2019-11-06 23:26:20 +0100
commit3b991527e8167f25ad1dfe780b9633c153600955 (patch)
tree6fa8634b4d27ba21142883d8fc9e719bf70c1d76 /src/buffer.c
parentf8b036bcae27014e4cbbdceec262b0a4c6dc2d9c (diff)
patch 8.1.2267: compiler warning for uninitialized variablev8.1.2267
Problem: Compiler warning for uninitialized variable. (Tony Mechelynck) Solution: Rearrange the code.
Diffstat (limited to 'src/buffer.c')
-rw-r--r--src/buffer.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/buffer.c b/src/buffer.c
index d190bdfab0..f7ff01ff97 100644
--- a/src/buffer.c
+++ b/src/buffer.c
@@ -3087,11 +3087,12 @@ buflist_list(exarg_T *eap)
qsort(buflist.ga_data, (size_t)buflist.ga_len,
sizeof(buf_T *), buf_compare);
- p = buflist_data = (buf_T **)buflist.ga_data;
- buf = *p;
+ buflist_data = (buf_T **)buflist.ga_data;
+ buf = *buflist_data;
}
+ p = buflist_data;
- for (; buf != NULL && !got_int; buf = buflist_data
+ for (; buf != NULL && !got_int; buf = buflist_data != NULL
? (++p < buflist_data + buflist.ga_len ? *p : NULL)
: buf->b_next)
#else