Skip to content

Commit

Permalink
patch 8.2.1892: valgrind warns for using uninitialized access in tests
Browse files Browse the repository at this point in the history
Problem:    Valgrind warns for using uninitialized access in tests.
Solution:   Fix condition for breaking out of loop. (Dominique Pellé,
            closes #7187)
  • Loading branch information
brammool committed Oct 23, 2020
1 parent 683581e commit 9c24cd1
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/terminal.c
Expand Up @@ -4718,6 +4718,7 @@ f_term_dumpwrite(typval_T *argvars, typval_T *rettv UNUSED)
{
int c = 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.
if (i == 0)
Expand All @@ -4727,7 +4728,7 @@ f_term_dumpwrite(typval_T *argvars, typval_T *rettv UNUSED)
}
if (c != pc)
same_chars = FALSE;
if (c == NUL || pc == NUL)
if (should_break)
break;
}
same_attr = vtermAttr2hl(cell.attrs)
Expand Down
2 changes: 2 additions & 0 deletions src/version.c
Expand Up @@ -750,6 +750,8 @@ static char *(features[]) =

static int included_patches[] =
{ /* Add new patch number below this line */
/**/
1892,
/**/
1891,
/**/
Expand Down

0 comments on commit 9c24cd1

Please sign in to comment.