diff src/autocmd.c @ 20751:d9a2e5dcfd9f v8.2.0928

patch 8.2.0928: many type casts are used for vim_strnsave() Commit: https://github.com/vim/vim/commit/df44a27b53586fccfc6a3aedc89061fdd9a515ff Author: Bram Moolenaar <Bram@vim.org> Date: Sun Jun 7 20:49:05 2020 +0200 patch 8.2.0928: many type casts are used for vim_strnsave() Problem: Many type casts are used for vim_strnsave(). Solution: Make the length argument size_t instead of int. (Ken Takata, closes #5633) Remove some type casts.
author Bram Moolenaar <Bram@vim.org>
date Sun, 07 Jun 2020 21:00:03 +0200
parents 435726a03481
children e76b83c07bd8
line wrap: on
line diff
--- a/src/autocmd.c
+++ b/src/autocmd.c
@@ -763,7 +763,7 @@ au_event_disable(char *what)
     save_ei = vim_strsave(p_ei);
     if (save_ei != NULL)
     {
-	new_ei = vim_strnsave(p_ei, (int)(STRLEN(p_ei) + STRLEN(what)));
+	new_ei = vim_strnsave(p_ei, STRLEN(p_ei) + STRLEN(what));
 	if (new_ei != NULL)
 	{
 	    if (*what == ',' && *p_ei == NUL)
@@ -991,7 +991,7 @@ au_get_grouparg(char_u **argp)
 	;
     if (p > arg)
     {
-	group_name = vim_strnsave(arg, (int)(p - arg));
+	group_name = vim_strnsave(arg, p - arg);
 	if (group_name == NULL)		// out of memory
 	    return AUGROUP_ERROR;
 	group = au_find_group(group_name);