Skip to content

Commit

Permalink
vt/pdckbd.c : a theoretically meaningless change, but Valgrind points…
Browse files Browse the repository at this point in the history
… out (correctly) that we access c[count], i.e., an uninitialized value. Reversing the order of comparisons avoids that access, has no actual effect on the code, and stops Valgrind from complaining.
  • Loading branch information
Bill-Gray committed Feb 7, 2020
1 parent a83f71c commit 9b80551
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vt/pdckbd.c
Original file line number Diff line number Diff line change
Expand Up @@ -227,7 +227,7 @@ static int xlate_vt_codes( const int *c, const int count)
if( count == tptr[1])
{
i = 0;
while( tptr[i + 2] == c[i] && i < count)
while( i < count && tptr[i + 2] == c[i])
i++;
if( i == count)
rval = tptr[0];
Expand Down

0 comments on commit 9b80551

Please sign in to comment.