Module Name: src
Committed By: roy
Date: Thu Feb 11 11:45:47 UTC 2010
Modified Files:
src/lib/libcurses: setterm.c
Log Message:
Don't assume the terminal has a description.
To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/lib/libcurses/setterm.c
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/lib/libcurses/setterm.c
diff -u src/lib/libcurses/setterm.c:1.46 src/lib/libcurses/setterm.c:1.47
--- src/lib/libcurses/setterm.c:1.46 Wed Feb 3 15:34:40 2010
+++ src/lib/libcurses/setterm.c Thu Feb 11 11:45:47 2010
@@ -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 =