]> granicus.if.org Git - vim/commitdiff
patch 8.1.2267: compiler warning for uninitialized variable v8.1.2267
authorBram Moolenaar <Bram@vim.org>
Wed, 6 Nov 2019 22:26:20 +0000 (23:26 +0100)
committerBram Moolenaar <Bram@vim.org>
Wed, 6 Nov 2019 22:26:20 +0000 (23:26 +0100)
Problem:    Compiler warning for uninitialized variable. (Tony Mechelynck)
Solution:   Rearrange the code.

src/buffer.c
src/version.c

index d190bdfab03c713c38550088bdf3ae34f510cc42..f7ff01ff9779b7dd0178dd26d95edf0cbfe12ace 100644 (file)
@@ -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
index 9bb1436c0f2e39dea33f22826c6a21727f1ebc1a..3cc98798c2e21758c9d83a91366c9e37aabca896 100644 (file)
@@ -741,6 +741,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    2267,
 /**/
     2266,
 /**/