0
0
mirror of https://github.com/vim/vim.git synced 2025-09-24 03:44:06 -04:00

patch 8.2.1892: valgrind warns for using uninitialized access in tests

Problem:    Valgrind warns for using uninitialized access in tests.
Solution:   Fix condition for breaking out of loop. (Dominique Pellé,
            closes #7187)
This commit is contained in:
Bram Moolenaar
2020-10-23 15:40:39 +02:00
parent 683581eb49
commit 9c24cd11e2
2 changed files with 4 additions and 1 deletions

View File

@@ -4718,6 +4718,7 @@ f_term_dumpwrite(typval_T *argvars, typval_T *rettv UNUSED)
{ {
int c = cell.chars[i]; int c = cell.chars[i];
int pc = prev_cell.chars[i]; int pc = prev_cell.chars[i];
int should_break = c == NUL || pc == NUL;
// For the first character NUL is the same as space. // For the first character NUL is the same as space.
if (i == 0) if (i == 0)
@@ -4727,7 +4728,7 @@ f_term_dumpwrite(typval_T *argvars, typval_T *rettv UNUSED)
} }
if (c != pc) if (c != pc)
same_chars = FALSE; same_chars = FALSE;
if (c == NUL || pc == NUL) if (should_break)
break; break;
} }
same_attr = vtermAttr2hl(cell.attrs) same_attr = vtermAttr2hl(cell.attrs)

View File

@@ -750,6 +750,8 @@ static char *(features[]) =
static int included_patches[] = static int included_patches[] =
{ /* Add new patch number below this line */ { /* Add new patch number below this line */
/**/
1892,
/**/ /**/
1891, 1891,
/**/ /**/