mirror of
https://github.com/neovim/neovim.git
synced 2025-09-19 17:58:18 +00:00
vim-patch:8.2.4623: Coverity warns for using uninitialized field
Problem: Coverity warns for using uninitialized field.
Solution: Initialize he field to zero.
03a297c63f
Also only initialize used fields in f_fullcommand().
This commit is contained in:
@@ -3271,6 +3271,7 @@ int cmd_exists(const char *const name)
|
|||||||
// For ":2match" and ":3match" we need to skip the number.
|
// For ":2match" and ":3match" we need to skip the number.
|
||||||
ea.cmd = (char *)((*name == '2' || *name == '3') ? name + 1 : name);
|
ea.cmd = (char *)((*name == '2' || *name == '3') ? name + 1 : name);
|
||||||
ea.cmdidx = (cmdidx_T)0;
|
ea.cmdidx = (cmdidx_T)0;
|
||||||
|
ea.flags = 0;
|
||||||
int full = false;
|
int full = false;
|
||||||
p = find_ex_command(&ea, &full);
|
p = find_ex_command(&ea, &full);
|
||||||
if (p == NULL) {
|
if (p == NULL) {
|
||||||
@@ -3288,6 +3289,7 @@ int cmd_exists(const char *const name)
|
|||||||
/// "fullcommand" function
|
/// "fullcommand" function
|
||||||
void f_fullcommand(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
void f_fullcommand(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
||||||
{
|
{
|
||||||
|
exarg_T ea;
|
||||||
char *name = argvars[0].vval.v_string;
|
char *name = argvars[0].vval.v_string;
|
||||||
|
|
||||||
rettv->v_type = VAR_STRING;
|
rettv->v_type = VAR_STRING;
|
||||||
@@ -3301,10 +3303,9 @@ void f_fullcommand(typval_T *argvars, typval_T *rettv, FunPtr fptr)
|
|||||||
}
|
}
|
||||||
name = skip_range(name, NULL);
|
name = skip_range(name, NULL);
|
||||||
|
|
||||||
exarg_T ea = {
|
ea.cmd = (*name == '2' || *name == '3') ? name + 1 : name;
|
||||||
.cmd = (*name == '2' || *name == '3') ? name + 1 : name,
|
ea.cmdidx = (cmdidx_T)0;
|
||||||
.cmdidx = (cmdidx_T)0,
|
ea.flags = 0;
|
||||||
};
|
|
||||||
char *p = find_ex_command(&ea, NULL);
|
char *p = find_ex_command(&ea, NULL);
|
||||||
if (p == NULL || ea.cmdidx == CMD_SIZE) {
|
if (p == NULL || ea.cmdidx == CMD_SIZE) {
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user