diff options
author | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-09-26 00:56:56 -0400 |
---|---|---|
committer | Jan Edmund Lazo <jan.lazo@mail.utoronto.ca> | 2019-10-01 22:27:44 -0400 |
commit | 56c860ac4a8897cdce8c7e6a9d238f0775de1979 (patch) | |
tree | 44ee3f84b9f1063b70fac603aab6d33058f2de68 | |
parent | 8732cce3150869d116a912ffea7686bfa73a6e0b (diff) | |
download | rneovim-56c860ac4a8897cdce8c7e6a9d238f0775de1979.tar.gz rneovim-56c860ac4a8897cdce8c7e6a9d238f0775de1979.tar.bz2 rneovim-56c860ac4a8897cdce8c7e6a9d238f0775de1979.zip |
quickfix: fix pvs/v547 errors
-rw-r--r-- | src/nvim/quickfix.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/nvim/quickfix.c b/src/nvim/quickfix.c index 5083e573d3..310b074cfb 100644 --- a/src/nvim/quickfix.c +++ b/src/nvim/quickfix.c @@ -1554,6 +1554,7 @@ static int qf_add_entry(qf_info_T *qi, int qf_idx, char_u *dir, char_u *fname, * Allocate a new location list */ static qf_info_T *ll_new_list(void) + FUNC_ATTR_NONNULL_RET { qf_info_T *qi = xcalloc(1, sizeof(qf_info_T)); qi->qf_refcount++; @@ -5650,7 +5651,7 @@ void ex_cexpr(exarg_T *eap) // Get the location list for ":lhelpgrep" static qf_info_T *hgr_get_ll(bool *new_ll) - FUNC_ATTR_NONNULL_ALL + FUNC_ATTR_NONNULL_ALL FUNC_ATTR_NONNULL_RET { win_T *wp; qf_info_T *qi; @@ -5670,9 +5671,7 @@ static qf_info_T *hgr_get_ll(bool *new_ll) } if (qi == NULL) { // Allocate a new location list for help text matches - if ((qi = ll_new_list()) == NULL) { - return NULL; - } + qi = ll_new_list(); *new_ll = true; } @@ -5810,9 +5809,6 @@ void ex_helpgrep(exarg_T *eap) if (eap->cmdidx == CMD_lhelpgrep) { qi = hgr_get_ll(&new_qi); - if (qi == NULL) { - return; - } } regmatch_T regmatch = { |