Fix fatal error when using the help command
Check that an action is defined for the key. Signed-off-by: Lars Henriksen <LarsHenriksen@get2net.dk> Signed-off-by: Lukas Fleischer <lfleischer@calcurse.org>
This commit is contained in:
parent
0df373f26a
commit
53db74ab34
@ -103,14 +103,15 @@ int display_help(const char *topic)
|
||||
|
||||
asprintf(&path, "%s/%s.txt", basedir, topic);
|
||||
|
||||
if (!io_file_exists(path) && keys_str2int(topic) > 0 &&
|
||||
keys_get_action(keys_str2int(topic)) > 0) {
|
||||
if (!io_file_exists(path)) {
|
||||
int ch = keys_str2int(topic);
|
||||
enum key action = keys_get_action(ch);
|
||||
if (ch > 0 && action > 0 && action != KEY_UNDEF) {
|
||||
topic = keys_get_label(action);
|
||||
mem_free(path);
|
||||
asprintf(&path, "%s/%s.txt", basedir, topic);
|
||||
}
|
||||
}
|
||||
|
||||
if (!io_file_exists(path)) {
|
||||
if (!strcmp(topic, "generic-credits"))
|
||||
|
Loading…
x
Reference in New Issue
Block a user