]> granicus.if.org Git - vim/commitdiff
patch 9.0.0501: warning for using uninitialized value in mouse test v9.0.0501
authorBram Moolenaar <Bram@vim.org>
Mon, 19 Sep 2022 10:44:11 +0000 (11:44 +0100)
committerBram Moolenaar <Bram@vim.org>
Mon, 19 Sep 2022 10:44:11 +0000 (11:44 +0100)
Problem:    Warning for using uninitialized value in mouse test.
Solution:   Clear ScreenCols when allocating it. (Dominique PellĂ©)

src/screen.c
src/version.c

index 27f4848378e9f526660dedc1b63b8ba9f68aee5b..06bda0d63a83e62469e25ae7158e1fd0e589fa9a 100644 (file)
@@ -2708,7 +2708,9 @@ retry:
     if (enc_dbcs == DBCS_JPNU)
        new_ScreenLines2 = LALLOC_MULT(schar_T, (Rows + 1) * Columns);
     new_ScreenAttrs = LALLOC_MULT(sattr_T, (Rows + 1) * Columns);
-    new_ScreenCols = LALLOC_MULT(colnr_T, (Rows + 1) * Columns);
+    // Clear ScreenCols to avoid a warning for unitialized memory in
+    // jump_to_mouse().
+    new_ScreenCols = LALLOC_CLEAR_MULT(colnr_T, (Rows + 1) * Columns);
     new_LineOffset = LALLOC_MULT(unsigned, Rows);
     new_LineWraps = LALLOC_MULT(char_u, Rows);
     new_TabPageIdxs = LALLOC_MULT(short, Columns);
index a167c38465a19b2a20e8ee8e27f5a3145601a195..46e7099d177a59871e2706efab9a561e5a0d393c 100644 (file)
@@ -699,6 +699,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    501,
 /**/
     500,
 /**/