1
0
forked from aniani/vim

patch 8.2.1564: a few remaining errors from ubsan

Problem:    A few remaining errors from ubsan.
Solution:   Avoid the warnings. (Dominique Pellé, closes #6837)
This commit is contained in:
Bram Moolenaar
2020-09-02 10:25:45 +02:00
parent 6f84b6db10
commit 4ad739fc05
4 changed files with 15 additions and 8 deletions

View File

@@ -3731,9 +3731,6 @@ cleanup_suggestions(
int maxscore,
int keep) // nr of suggestions to keep
{
suggest_T *stp = &SUG(*gap, 0);
int i;
if (gap->ga_len > 0)
{
// Sort the list.
@@ -3744,6 +3741,9 @@ cleanup_suggestions(
// displayed.
if (gap->ga_len > keep)
{
int i;
suggest_T *stp = &SUG(*gap, 0);
for (i = keep; i < gap->ga_len; ++i)
vim_free(stp[i].st_word);
gap->ga_len = keep;