Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses Don't assume the terminal has a description.



details:   https://anonhg.NetBSD.org/src/rev/eb3e8b9febae
branches:  trunk
changeset: 752019:eb3e8b9febae
user:      roy <roy%NetBSD.org@localhost>
date:      Thu Feb 11 11:45:47 2010 +0000

description:
Don't assume the terminal has a description.

diffstat:

 lib/libcurses/setterm.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (32 lines):

diff -r 8af55bf41429 -r eb3e8b9febae lib/libcurses/setterm.c
--- a/lib/libcurses/setterm.c   Thu Feb 11 10:07:14 2010 +0000
+++ b/lib/libcurses/setterm.c   Thu Feb 11 11:45:47 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: setterm.c,v 1.46 2010/02/03 15:34:40 roy Exp $ */
+/*     $NetBSD: setterm.c,v 1.47 2010/02/11 11:45:47 roy Exp $ */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)setterm.c  8.8 (Berkeley) 10/25/94";
 #else
-__RCSID("$NetBSD: setterm.c,v 1.46 2010/02/03 15:34:40 roy Exp $");
+__RCSID("$NetBSD: setterm.c,v 1.47 2010/02/11 11:45:47 roy Exp $");
 #endif
 #endif /* not lint */
 
@@ -132,8 +132,11 @@
                strcpy(screen->ttytype, "dumb");
                return ERR;
        }
-       strlcpy(screen->ttytype, screen->term->desc,
-               sizeof(screen->ttytype));
+       if (screen->term->desc == NULL)
+               screen->ttytype[0] = '\0';
+       else
+               strlcpy(screen->ttytype, screen->term->desc,
+                   sizeof(screen->ttytype));
 
        /* If no scrolling commands, no quick change. */
        screen->noqch =



Home | Main Index | Thread Index | Old Index