delete spurious debug abort()
[unix-history] / usr / src / lib / libcurses / setterm.c
index 0151f37..1dd8bd2 100644 (file)
@@ -1,7 +1,7 @@
 /*
  * Terminal initialization routines.
  *
 /*
  * Terminal initialization routines.
  *
- * %G% (Berkeley) @(#)setterm.c        1.10
+ * %G% (Berkeley) @(#)setterm.c        1.12
  */
 
 # include      "curses.ext"
  */
 
 # include      "curses.ext"
@@ -57,8 +57,8 @@ gettmode() {
 setterm(type)
 reg char       *type; {
 
 setterm(type)
 reg char       *type; {
 
-       reg int unknown;
-       char    genbuf[1024];
+       reg int         unknown;
+       static char     genbuf[1024];
 
 # ifdef DEBUG
        fprintf(outf, "SETTERM(\"%s\")\n", type);
 
 # ifdef DEBUG
        fprintf(outf, "SETTERM(\"%s\")\n", type);
@@ -146,7 +146,7 @@ zap() {
        } while (*namp);
        SG = tgetnum("sg");
        UG = tgetnum("ug");
        } while (*namp);
        SG = tgetnum("sg");
        UG = tgetnum("ug");
-       if ((SG || !SO) && (!UG && US)) {
+       if ((SG > 0 || !SO) && (UG <= 0 && US)) {
                SO = US;
                SE = UE;
        }
                SO = US;
                SE = UE;
        }