mirror of
https://github.com/sheumann/hush.git
synced 2025-03-27 02:30:19 +00:00
Error handling in case termcap entry can't be found
This commit is contained in:
parent
6dfc5eadb3
commit
5b1c69f8d6
@ -276,7 +276,10 @@ static void init_termcap(void)
|
||||
termcap_buffer = malloc(TERMCAP_BUFSIZ);
|
||||
if (termcap_buffer == NULL)
|
||||
return;
|
||||
tgetent(termcap_buffer, term);
|
||||
if (tgetent(termcap_buffer, term) != 1) {
|
||||
free(termcap_buffer);
|
||||
return;
|
||||
}
|
||||
|
||||
result = tgetstr("up", &string_buf);
|
||||
if (result != NULL)
|
||||
|
Loading…
x
Reference in New Issue
Block a user