coverity/90712: Remove unnecessary check for NULL.

** CID 90712:  Dereference after null check  (FORWARD_NULL)
/src/nvim/getchar.c: 3654 in check_abbr()

vim_strsave() never returns NULL, so q is never NULL. Removing the
NULL check for q should fix this warning.
This commit is contained in:
oni-link 2014-12-26 12:26:09 +01:00
parent e241b0ba09
commit ce03171323

View File

@ -3645,11 +3645,9 @@ int check_abbr(int c, char_u *ptr, int col, int mincol)
if (vim_strbyte(mp->m_keys, K_SPECIAL) != NULL) {
/* might have CSI escaped mp->m_keys */
q = vim_strsave(mp->m_keys);
if (q != NULL) {
vim_unescape_csi(q);
qlen = (int)STRLEN(q);
}
}
/* find entries with right mode and keys */
match = (mp->m_mode & State)
&& qlen == len