aboutsummaryrefslogtreecommitdiff
path: root/src/nvim/spell.c
diff options
context:
space:
mode:
authorJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-09-02 22:22:15 -0400
committerJan Edmund Lazo <jan.lazo@mail.utoronto.ca>2020-09-02 22:44:21 -0400
commit5fcdb630253b8d71fd30a2259f72aeb27e1676e0 (patch)
tree1a891b01dbca622ed8e4cbb5930d1a6425d146ba /src/nvim/spell.c
parentb9430fe28ef8c5a865b3bee5c7f523abc3b1947a (diff)
downloadrneovim-5fcdb630253b8d71fd30a2259f72aeb27e1676e0.tar.gz
rneovim-5fcdb630253b8d71fd30a2259f72aeb27e1676e0.tar.bz2
rneovim-5fcdb630253b8d71fd30a2259f72aeb27e1676e0.zip
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 vim/vim#6837) https://github.com/vim/vim/commit/4ad739fc053c1666d07ba1cf59be26cb1c3e52d7
Diffstat (limited to 'src/nvim/spell.c')
-rw-r--r--src/nvim/spell.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/nvim/spell.c b/src/nvim/spell.c
index 95948dac78..ad235f1f14 100644
--- a/src/nvim/spell.c
+++ b/src/nvim/spell.c
@@ -5765,14 +5765,14 @@ cleanup_suggestions (
)
FUNC_ATTR_NONNULL_ALL
{
- suggest_T *stp = &SUG(*gap, 0);
-
if (gap->ga_len > 0) {
// Sort the list.
qsort(gap->ga_data, (size_t)gap->ga_len, sizeof(suggest_T), sug_compare);
// Truncate the list to the number of suggestions that will be displayed.
if (gap->ga_len > keep) {
+ suggest_T *const stp = &SUG(*gap, 0);
+
for (int i = keep; i < gap->ga_len; i++) {
xfree(stp[i].st_word);
}