Patch 8.2.0387
Problem: Error for possible NULL argument to qsort().
Solution: Don't call qsort() when there is nothing to sort. (Dominique
Pelle, closes #5780)
Files: src/spellsuggest.c
*** ../vim-8.2.0386/src/spellsuggest.c 2019-12-25 14:13:00.241985456 +0100
--- src/spellsuggest.c 2020-03-15 18:13:18.943277934 +0100
***************
*** 3719,3735 ****
suggest_T *stp = &SUG(*gap, 0);
int i;
! // 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)
{
! for (i = keep; i < gap->ga_len; ++i)
! vim_free(stp[i].st_word);
! gap->ga_len = keep;
! if (keep >= 1)
! return stp[keep - 1].st_score;
}
return maxscore;
}
--- 3719,3740 ----
suggest_T *stp = &SUG(*gap, 0);
int i;
! 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)
! {
! for (i = keep; i < gap->ga_len; ++i)
! vim_free(stp[i].st_word);
! gap->ga_len = keep;
! if (keep >= 1)
! return stp[keep - 1].st_score;
! }
}
return maxscore;
}
*** ../vim-8.2.0386/src/version.c 2020-03-15 16:51:36.934946237 +0100
--- src/version.c 2020-03-15 18:14:17.771043831 +0100
***************
*** 740,741 ****
--- 740,743 ----
{ /* Add new patch number below this line */
+ /**/
+ 387,
/**/
--
hundred-and-one symptoms of being an internet addict:
269. You wonder how you can make your dustbin produce Sesame Street's
Oscar's the Garbage Monster song when you empty it.
/// Bram Moolenaar -- [email protected] -- http://www.Moolenaar.net \\\
/// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\ an exciting new programming language -- http://www.Zimbu.org ///
\\\ help me help AIDS victims -- http://ICCF-Holland.org ///
--
--
You received this message from the "vim_dev" maillist.
Do not top-post! Type your reply below the text you are replying to.
For more information, visit http://www.vim.org/maillist.php
---
You received this message because you are subscribed to the Google Groups
"vim_dev" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To view this discussion on the web visit
https://groups.google.com/d/msgid/vim_dev/202003151715.02FHFkdQ000995%40masaka.moolenaar.net.