]> granicus.if.org Git - vim/commitdiff
patch 8.2.3755: Coverity warns for using a buffer in another scope v8.2.3755
authorBram Moolenaar <Bram@vim.org>
Tue, 7 Dec 2021 11:03:39 +0000 (11:03 +0000)
committerBram Moolenaar <Bram@vim.org>
Tue, 7 Dec 2021 11:03:39 +0000 (11:03 +0000)
Problem:    Coverity warns for using a buffer in another scope.
Solution:   Declare the buffer in a common scope.

src/evalvars.c
src/version.c

index f5465cfb745ed73cdb6e346e867979ae3ae750ac..60df7238f9664366e662ccab930f09dbede5d3a8 100644 (file)
@@ -1393,6 +1393,8 @@ ex_let_option(
        int         failed = FALSE;
        int         opt_p_flags;
        char_u      *tofree = NULL;
+       char_u      numbuf[NUMBUFLEN];
+
 
        c1 = *p;
        *p = NUL;
@@ -1416,12 +1418,9 @@ ex_let_option(
        if (opt_p_flags & P_FUNC && (tv->v_type == VAR_PARTIAL
                                                || tv->v_type == VAR_FUNC))
        {
-           char_u      numbuf[NUMBUFLEN];
-
            // If the option can be set to a function reference or a lambda
            // and the passed value is a function reference, then convert it to
            // the name (string) of the function reference.
-
            s = tv2string(tv, &tofree, numbuf, 0);
        }
        // Avoid setting a string option to the text "v:false" or similar.
index d0ccf16883a17d2462d95430f82a114f5a548024..294547b8626c5e3486189e6bab1deff596d84a89 100644 (file)
@@ -753,6 +753,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    3755,
 /**/
     3754,
 /**/