diff options
Diffstat (limited to 'src/nvim/term.c')
-rw-r--r-- | src/nvim/term.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/term.c b/src/nvim/term.c index 59f44c9f3e..733bef8b5f 100644 --- a/src/nvim/term.c +++ b/src/nvim/term.c @@ -2983,8 +2983,7 @@ void add_termcode(char_u *name, char_u *string, int flags) */ if (tc_len == tc_max_len) { tc_max_len += 20; - new_tc = (struct termcode *)alloc( - (unsigned)(tc_max_len * sizeof(struct termcode))); + new_tc = xmalloc(tc_max_len * sizeof(struct termcode)); for (i = 0; i < tc_len; ++i) new_tc[i] = termcodes[i]; free(termcodes); @@ -4170,7 +4169,7 @@ replace_termcodes ( * Allocate space for the translation. Worst case a single character is * replaced by 6 bytes (shifted special key), plus a NUL at the end. */ - result = alloc((unsigned)STRLEN(from) * 6 + 1); + result = xmalloc(STRLEN(from) * 6 + 1); src = from; @@ -4376,7 +4375,7 @@ void show_termcodes(void) if (tc_len == 0) /* no terminal codes (must be GUI) */ return; - items = (int *)alloc((unsigned)(sizeof(int) * tc_len)); + items = xmalloc(sizeof(int) * tc_len); /* Highlight title */ MSG_PUTS_TITLE(_("\n--- Terminal keys ---")); |