소스 검색

Fix initscr() crash on NetBSD

NetBSD has its own curses implementation and initscr() does not
terminate with an error if TERM is not set properly.

Instead check the return value and exit if an initialization
error occurs.
master
sin 9 년 전
부모
커밋
3ccbaef87b
1개의 변경된 파일10개의 추가작업 그리고 1개의 파일을 삭제
  1. +10
    -1
      noice.c

+ 10
- 1
noice.c 파일 보기

@@ -257,7 +257,16 @@ entrycmp(const void *va, const void *vb)
void
initcurses(void)
{
initscr();
char *term;

if (initscr() == NULL) {
term = getenv("TERM");
if (term != NULL)
fprintf(stderr, "error opening terminal: %s\n", term);
else
fprintf(stderr, "failed to initialize curses\n");
exit(1);
}
cbreak();
noecho();
nonl();


불러오는 중...
취소
저장