aboutsummaryrefslogtreecommitdiff
path: root/src/edit.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/edit.c b/src/edit.c
index 31c794dba3..53bb8815ec 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -2125,7 +2125,7 @@ ins_compl_add (
* Allocate a new match structure.
* Copy the values to the new match structure.
*/
- match = (compl_T *)alloc_clear((unsigned)sizeof(compl_T));
+ match = xcalloc(1, sizeof(compl_T));
match->cp_number = -1;
if (flags & ORIGINAL_TEXT)
match->cp_number = 0;
@@ -2460,9 +2460,9 @@ void ins_compl_show_pum(void)
} while (compl != NULL && compl != compl_first_match);
if (compl_match_arraysize == 0)
return;
- compl_match_array = (pumitem_T *)alloc_clear(
- (unsigned)(sizeof(pumitem_T)
- * compl_match_arraysize));
+
+ assert(compl_match_arraysize >= 0);
+ compl_match_array = xcalloc(compl_match_arraysize, sizeof(pumitem_T));
/* If the current match is the original text don't find the first
* match after it, don't highlight anything. */
if (compl_shown_match->cp_flags & ORIGINAL_TEXT)