diff src/spellsuggest.c @ 22021:514d622473af v8.2.1560

patch 8.2.1560: using NULL pointers in some code Commit: https://github.com/vim/vim/commit/9c2b06637b32742cac11bfd66b1a4e84583c6c2e Author: Bram Moolenaar <Bram@vim.org> Date: Tue Sep 1 19:56:15 2020 +0200 patch 8.2.1560: using NULL pointers in some code Problem: Using NULL pointers in some code. (James McCoy) Solution: Avoid adding to a NULL pointer. Use byte as unsigned.
author Bram Moolenaar <Bram@vim.org>
date Tue, 01 Sep 2020 20:00:03 +0200
parents 47978b89a02e
children 2d6d70a913c1
line wrap: on
line diff
--- a/src/spellsuggest.c
+++ b/src/spellsuggest.c
@@ -3606,6 +3606,8 @@ check_suggestions(
     int		len;
     hlf_T	attr;
 
+    if (gap->ga_len == 0)
+	return;
     stp = &SUG(*gap, 0);
     for (i = gap->ga_len - 1; i >= 0; --i)
     {