tui: Fix V547: always true condition

The variable in question is initalized at the start of the function with
something non-NULL, specifically pointer to a static buffer.
This commit is contained in:
ZyX 2017-05-20 04:39:55 +03:00
parent d9398982ea
commit a494bf847d

View File

@ -1123,13 +1123,13 @@ static const char *tui_tk_ti_getstr(const char *name, const char *value,
if (strequal(name, "key_backspace")) { if (strequal(name, "key_backspace")) {
ILOG("libtermkey:kbs=%s", value); ILOG("libtermkey:kbs=%s", value);
if (stty_erase != NULL && stty_erase[0] != 0) { if (stty_erase[0] != 0) {
return stty_erase; return stty_erase;
} }
} else if (strequal(name, "key_dc")) { } else if (strequal(name, "key_dc")) {
ILOG("libtermkey:kdch1=%s", value); ILOG("libtermkey:kdch1=%s", value);
// Vim: "If <BS> and <DEL> are now the same, redefine <DEL>." // Vim: "If <BS> and <DEL> are now the same, redefine <DEL>."
if (stty_erase != NULL && value != NULL && strequal(stty_erase, value)) { if (value != NULL && strequal(stty_erase, value)) {
return stty_erase[0] == DEL ? CTRL_H_STR : DEL_STR; return stty_erase[0] == DEL ? CTRL_H_STR : DEL_STR;
} }
} }