diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2021-05-15 20:36:13 -0400 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-05-15 20:36:13 -0400 |
commit | 6ab83f35724737a7b74cfee0d21abe7c815f0a1a (patch) | |
tree | 1ba010375f371963fea6f0b765ecbca7bda30d84 /src/nvim/eval/funcs.c | |
parent | d67dcaba02d76fe92ba818dde7b672fe6956a100 (diff) | |
download | rneovim-6ab83f35724737a7b74cfee0d21abe7c815f0a1a.tar.gz rneovim-6ab83f35724737a7b74cfee0d21abe7c815f0a1a.tar.bz2 rneovim-6ab83f35724737a7b74cfee0d21abe7c815f0a1a.zip |
Add 'FUNC_ATTR_NONNULL_RET' to nonnull alloc funcs (#14559)
Diffstat (limited to 'src/nvim/eval/funcs.c')
-rw-r--r-- | src/nvim/eval/funcs.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/nvim/eval/funcs.c b/src/nvim/eval/funcs.c index c2e1639624..072d206ecb 100644 --- a/src/nvim/eval/funcs.c +++ b/src/nvim/eval/funcs.c @@ -2770,10 +2770,9 @@ static void f_get(typval_T *argvars, typval_T *rettv, FunPtr fptr) } } else if (strcmp(what, "args") == 0) { rettv->v_type = VAR_LIST; - if (tv_list_alloc_ret(rettv, pt->pt_argc) != NULL) { - for (int i = 0; i < pt->pt_argc; i++) { - tv_list_append_tv(rettv->vval.v_list, &pt->pt_argv[i]); - } + tv_list_alloc_ret(rettv, pt->pt_argc); + for (int i = 0; i < pt->pt_argc; i++) { + tv_list_append_tv(rettv->vval.v_list, &pt->pt_argv[i]); } } else { EMSG2(_(e_invarg2), what); |