diff src/vim9execute.c @ 23582:b875bbd517a6 v8.2.2333

patch 8.2.2333: Vim9: warning for uninitialized variable Commit: https://github.com/vim/vim/commit/cb6cbf29e97b7abdeb1e6cbdc5e735f5b55e97a1 Author: Bram Moolenaar <Bram@vim.org> Date: Tue Jan 12 17:17:01 2021 +0100 patch 8.2.2333: Vim9: warning for uninitialized variable Problem: Vim9: warning for uninitialized variable. (Tony Mechelynck) Solution: Initialize "res".
author Bram Moolenaar <Bram@vim.org>
date Tue, 12 Jan 2021 17:30:05 +0100
parents dc3b7a31c29f
children 1816ea68c022
line wrap: on
line diff
--- a/src/vim9execute.c
+++ b/src/vim9execute.c
@@ -754,7 +754,7 @@ call_partial(typval_T *tv, int argcount_
     int		argcount = argcount_arg;
     char_u	*name = NULL;
     int		called_emsg_before = called_emsg;
-    int		res;
+    int		res = FAIL;
 
     if (tv->v_type == VAR_PARTIAL)
     {
@@ -800,7 +800,7 @@ call_partial(typval_T *tv, int argcount_
 	vim_free(tofree);
     }
 
-    if (name == NULL || res == FAIL)
+    if (res == FAIL)
     {
 	if (called_emsg == called_emsg_before)
 	    semsg(_(e_unknownfunc),