]> granicus.if.org Git - vim/commitdiff
patch 8.1.1312: Coverity warning for using uninitialized variable v8.1.1312
authorBram Moolenaar <Bram@vim.org>
Thu, 9 May 2019 19:48:37 +0000 (21:48 +0200)
committerBram Moolenaar <Bram@vim.org>
Thu, 9 May 2019 19:48:37 +0000 (21:48 +0200)
Problem:    Coverity warning for using uninitialized variable.
Solution:   Clear exarg_T.

src/channel.c
src/ex_cmds2.c
src/quickfix.c
src/version.c

index aac8656cf1e61bd6e542eb162a3746c212e60341..a29414f69f3b043e91f443f8a9d1774454a86fd4 100644 (file)
@@ -2308,6 +2308,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
        exarg_T ea;
 
        ch_log(channel, "Executing normal command '%s'", (char *)arg);
+       vim_memset(&ea, 0, sizeof(ea));
        ea.arg = arg;
        ea.addr_count = 0;
        ea.forceit = TRUE; /* no mapping */
@@ -2318,6 +2319,7 @@ channel_exe_cmd(channel_T *channel, ch_part_T part, typval_T *argv)
        exarg_T ea;
 
        ch_log(channel, "redraw");
+       vim_memset(&ea, 0, sizeof(ea));
        ea.forceit = *arg != NUL;
        ex_redraw(&ea);
        showruler(FALSE);
index 1e9d18e833509fc65947bf712d7747d966f8df8c..8bab8536b39742c9e7f4500f44b80363bf15b574 100644 (file)
@@ -1190,9 +1190,9 @@ dialog_changed(
     else
        ret = vim_dialog_yesnocancel(VIM_QUESTION, NULL, buff, 1);
 
-    /* Init ea pseudo-structure, this is needed for the check_overwrite()
-     * function. */
-    ea.append = ea.forceit = FALSE;
+    // Init ea pseudo-structure, this is needed for the check_overwrite()
+    // function.
+    vim_memset(&ea, 0, sizeof(ea));
 
     if (ret == VIM_YES)
     {
index 61576505a92f8ba01d083397f056d922ee657b31..cf3b274843f6b36542f04a8310cbc74fa044eaae 100644 (file)
@@ -5809,6 +5809,7 @@ vgr_jump_to_match(
     {
        exarg_T ea;
 
+       vim_memset(&ea, 0, sizeof(ea));
        ea.arg = target_dir;
        ea.cmdidx = CMD_lcd;
        ex_cd(&ea);
@@ -6109,6 +6110,7 @@ restore_start_dir(char_u *dirname_start)
            // appropriate ex command and executing it.
            exarg_T ea;
 
+           vim_memset(&ea, 0, sizeof(ea));
            ea.arg = dirname_start;
            ea.cmdidx = (curwin->w_localdir == NULL) ? CMD_cd : CMD_lcd;
            ex_cd(&ea);
index a9b376e23bc14ac7486defb1c40641e4ccd7f986..2b936d772dd8d0b307f6672fc76b3c848594aebc 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1312,
 /**/
     1311,
 /**/