changeset 18546:f609865bfc54 v8.1.2267

patch 8.1.2267: compiler warning for uninitialized variable Commit: https://github.com/vim/vim/commit/3b991527e8167f25ad1dfe780b9633c153600955 Author: Bram Moolenaar <Bram@vim.org> Date: Wed Nov 6 23:26:20 2019 +0100 patch 8.1.2267: compiler warning for uninitialized variable Problem: Compiler warning for uninitialized variable. (Tony Mechelynck) Solution: Rearrange the code.
author Bram Moolenaar <Bram@vim.org>
date Wed, 06 Nov 2019 23:30:03 +0100
parents 3bb39398b093
children 2602ebaedfda
files src/buffer.c src/version.c
diffstat 2 files changed, 7 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- 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;
     }
-
-    for (; buf != NULL && !got_int; buf = buflist_data
+    p = buflist_data;
+
+    for (; buf != NULL && !got_int; buf = buflist_data != NULL
 	    ? (++p < buflist_data + buflist.ga_len ? *p : NULL)
 	    : buf->b_next)
 #else
--- a/src/version.c
+++ b/src/version.c
@@ -742,6 +742,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    2267,
+/**/
     2266,
 /**/
     2265,