]> granicus.if.org Git - vim/commitdiff
patch 8.1.1463: gcc warns for uninitialized variable v8.1.1463
authorBram Moolenaar <Bram@vim.org>
Tue, 4 Jun 2019 17:16:29 +0000 (19:16 +0200)
committerBram Moolenaar <Bram@vim.org>
Tue, 4 Jun 2019 17:16:29 +0000 (19:16 +0200)
Problem:    Gcc warns for uninitialized variable.
Solution:   Put usage inside "if".  (Ken Takata)

src/textprop.c
src/version.c

index 2d7567cdb03268d8f4162fd4f3a0552eca95cdce..f219b925fa1a4833900f7e494d9e326e5d833bbf 100644 (file)
@@ -1240,9 +1240,12 @@ join_prop_lines(
     if (line == NULL)
        return;
     mch_memmove(line, newp, len);
-    l = oldproplen * sizeof(textprop_T);
-    mch_memmove(line + len, props, l);
-    len += l;
+    if (oldproplen > 0)
+    {
+       l = oldproplen * sizeof(textprop_T);
+       mch_memmove(line + len, props, l);
+       len += l;
+    }
 
     for (i = 0; i < count - 1; ++i)
        if (prop_lines[i] != NULL)
index ec6ee205d7834522f3000427bfb3ef00bdabd11e..7d86aaeb467894c02ef3224144c7fd86b319b9ba 100644 (file)
@@ -767,6 +767,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    1463,
 /**/
     1462,
 /**/