]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 9.0.0075: some compilers warn for using an uninitialized variable v9.0.0075
authorBram Moolenaar <Bram@vim.org>
Tue, 26 Jul 2022 10:42:34 +0000 (11:42 +0100)
committerBram Moolenaar <Bram@vim.org>
Tue, 26 Jul 2022 10:42:34 +0000 (11:42 +0100)
Problem:    Some compilers warn for using an uninitialized variable. (Tony
            Mechelynck)
Solution:   Initialize the variable.

src/drawline.c
src/version.c

index 76176ab24c4a3f1559989462dc8eb156a81937ce..666e32d1c8ed87d256e452b0bc3ad29553132a90 100644 (file)
@@ -1486,7 +1486,7 @@ win_line(
                text_prop_id = 0;
                if (text_props_active > 0)
                {
-                   int used_tpi;
+                   int used_tpi = -1;
                    int used_attr = 0;
 
                    // Sort the properties on priority and/or starting last.
@@ -1514,7 +1514,7 @@ win_line(
                            used_tpi = tpi;
                        }
                    }
-                   if (n_extra == 0 && text_prop_id < 0
+                   if (n_extra == 0 && text_prop_id < 0 && used_tpi >= 0
                            && -text_prop_id
                                      <= wp->w_buffer->b_textprop_text.ga_len)
                    {
index f7cbaf81bd3799486cb979bd4d89f4c3a428c311..1909fd4b423f3c054453d43ef00174cf8a9c34e3 100644 (file)
@@ -735,6 +735,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    75,
 /**/
     74,
 /**/