diff options
author | Bram Moolenaar <Bram@vim.org> | 2017-01-24 20:47:50 +0100 |
---|---|---|
committer | Bram Moolenaar <Bram@vim.org> | 2017-01-24 20:47:50 +0100 |
commit | 6a717f17ec6b09634be1c29e0ac4c35213f7b32d (patch) | |
tree | c6f88304ae5fb437f2fb2836f71a66041ab52147 | |
parent | b031c4ea04eb1e37a873fbb85e90d835aa1e2b1c (diff) | |
download | vim-6a717f17ec6b09634be1c29e0ac4c35213f7b32d.zip |
patch 8.0.0236: gcc complains about uninitialized variable
Problem: Gcc complains that a variable may be used uninitialized. Confusion
between variable and label name. (John Marriott)
Solution: Initialize it. Rename end to end_lnum.
-rw-r--r-- | src/ops.c | 10 | ||||
-rw-r--r-- | src/version.c | 2 |
2 files changed, 7 insertions, 5 deletions
@@ -3774,13 +3774,13 @@ do_put( */ if (y_type == MCHAR && y_size == 1) { - linenr_T end; + linenr_T end_lnum = 0; /* init for gcc */ if (VIsual_active) { - end = curbuf->b_visual.vi_end.lnum; - if (end < curbuf->b_visual.vi_start.lnum) - end = curbuf->b_visual.vi_start.lnum; + end_lnum = curbuf->b_visual.vi_end.lnum; + if (end_lnum < curbuf->b_visual.vi_start.lnum) + end_lnum = curbuf->b_visual.vi_start.lnum; } do { @@ -3815,7 +3815,7 @@ do_put( } if (VIsual_active) lnum++; - } while (VIsual_active && lnum <= end); + } while (VIsual_active && lnum <= end_lnum); if (VIsual_active) /* reset lnum to the last visual line */ lnum--; diff --git a/src/version.c b/src/version.c index 65208d0a0..684a244cd 100644 --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 236, +/**/ 235, /**/ 234, |