Make sure setupterm() returns ERR before examining the status value.

git-svn-id: svn://svn.code.sf.net/p/bitchx/code/trunk@252 13b04d17-f746-0410-82c6-800466cd88b0
This commit is contained in:
Tim Cava
2013-07-01 01:23:18 +00:00
parent c464efa90e
commit 4ff0b8d2d5

View File

@@ -842,8 +842,7 @@ int term_init (char *term)
fprintf(stdout, "Using terminal type [%s]\n", term); fprintf(stdout, "Using terminal type [%s]\n", term);
#endif #endif
#ifdef HAVE_TERMINFO #ifdef HAVE_TERMINFO
setupterm(NULL, 1, &i); if (setupterm(NULL, 1, &i) == ERR)
if (i != 1)
{ {
fprintf(stderr, "setupterm failed: %d\n", i); fprintf(stderr, "setupterm failed: %d\n", i);
fprintf(stderr, "So we'll be running in dumb mode...\n"); fprintf(stderr, "So we'll be running in dumb mode...\n");