summaryrefslogtreecommitdiff
path: root/src/textprop.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2019-06-04 19:16:29 +0200
committerBram Moolenaar <Bram@vim.org>2019-06-04 19:16:29 +0200
commit277e79adc4d2b62556ce8a3720684e4b3e1e6d42 (patch)
tree15c29d5d307cd7784ef4e435f20030d13aa6290d /src/textprop.c
parentc974022c31e790136c62586eb0b0ace2d02d2afb (diff)
downloadvim-git-277e79adc4d2b62556ce8a3720684e4b3e1e6d42.tar.gz
patch 8.1.1463: gcc warns for uninitialized variablev8.1.1463
Problem: Gcc warns for uninitialized variable. Solution: Put usage inside "if". (Ken Takata)
Diffstat (limited to 'src/textprop.c')
-rw-r--r--src/textprop.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/textprop.c b/src/textprop.c
index 2d7567cdb..f219b925f 100644
--- a/src/textprop.c
+++ b/src/textprop.c
@@ -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)