diff src/misc1.c @ 20830:9064044fd4f6 v8.2.0967

patch 8.2.0967: unnecessary type casts for vim_strnsave() Commit: https://github.com/vim/vim/commit/71ccd03ee8a43b20000214a9c99dcc90f039edca Author: Bram Moolenaar <Bram@vim.org> Date: Fri Jun 12 22:59:11 2020 +0200 patch 8.2.0967: unnecessary type casts for vim_strnsave() Problem: Unnecessary type casts for vim_strnsave(). Solution: Remove the type casts.
author Bram Moolenaar <Bram@vim.org>
date Fri, 12 Jun 2020 23:00:04 +0200
parents 072ad890c227
children 80b4e604d1d5
line wrap: on
line diff
--- a/src/misc1.c
+++ b/src/misc1.c
@@ -1795,7 +1795,7 @@ vim_getenv(char_u *name, int *mustfree)
 	    if (p == exe_name || p == p_hf)
 #endif
 		// check that the result is a directory name
-		p = vim_strnsave(p, (int)(pend - p));
+		p = vim_strnsave(p, pend - p);
 
 	    if (p != NULL && !mch_isdir(p))
 		VIM_CLEAR(p);
@@ -2576,7 +2576,7 @@ get_isolated_shell_name(void)
 
 #ifdef MSWIN
     p = gettail(p_sh);
-    p = vim_strnsave(p, (int)(skiptowhite(p) - p));
+    p = vim_strnsave(p, skiptowhite(p) - p);
 #else
     p = skiptowhite(p_sh);
     if (*p == NUL)
@@ -2593,7 +2593,7 @@ get_isolated_shell_name(void)
 	for (p2 = p_sh; p2 < p; MB_PTR_ADV(p2))
 	    if (vim_ispathsep(*p2))
 		p1 = p2 + 1;
-	p = vim_strnsave(p1, (int)(p - p1));
+	p = vim_strnsave(p1, p - p1);
     }
 #endif
     return p;