diff options
author | Peter Wemm <peter@FreeBSD.org> | 2000-01-26 16:55:09 +0000 |
---|---|---|
committer | Peter Wemm <peter@FreeBSD.org> | 2000-01-26 16:55:09 +0000 |
commit | 5bd21f8a0ac1990a5710ab70212d579cc9f46f1e (patch) | |
tree | c3b546eb9329fda139cb9637b33b45efac8c584a /contrib/ncurses | |
parent | b02c95d4983d360674e55a30bd06a2b40ff2f18d (diff) | |
download | src-test2-5bd21f8a0ac1990a5710ab70212d579cc9f46f1e.tar.gz src-test2-5bd21f8a0ac1990a5710ab70212d579cc9f46f1e.zip |
Notes
Diffstat (limited to 'contrib/ncurses')
-rw-r--r-- | contrib/ncurses/ncurses/tinfo/lib_termcap.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/contrib/ncurses/ncurses/tinfo/lib_termcap.c b/contrib/ncurses/ncurses/tinfo/lib_termcap.c index e26ca53f8c29..b34ced5fec6b 100644 --- a/contrib/ncurses/ncurses/tinfo/lib_termcap.c +++ b/contrib/ncurses/ncurses/tinfo/lib_termcap.c @@ -31,6 +31,8 @@ * and: Eric S. Raymond <esr@snark.thyrsus.com> * ****************************************************************************/ +/* $FreeBSD$ */ + #include <curses.priv.h> #include <termcap.h> @@ -39,7 +41,7 @@ #define __INTERNAL_CAPS_VISIBLE #include <term_entry.h> -MODULE_ID("$Id: lib_termcap.c,v 1.28 1999/02/27 22:12:58 tom Exp $") +MODULE_ID("$Id: lib_termcap.c,v 1.29 1999/09/05 01:06:43 tom Exp $") /* some of the code in here was contributed by: @@ -177,7 +179,7 @@ int i; * ***************************************************************************/ -char *tgetstr(NCURSES_CONST char *id, char **area GCC_UNUSED) +char *tgetstr(NCURSES_CONST char *id, char **area) { int i; @@ -190,12 +192,12 @@ int i; if (!strncmp(id, capname, 2)) { T(("found match : %s", _nc_visbuf(tp->Strings[i]))); /* setupterm forces cancelled strings to null */ -#ifdef FREEBSD_NATIVE - if (*area && tp->Strings[i]) { - strcpy(*area, tp->Strings[i]); - *area += strlen(tp->Strings[i]) + 1; + if (area != 0 + && *area != 0 + && VALID_STRING(tp->Strings[i])) { + (void) strcpy(*area, tp->Strings[i]); + *area += strlen(*area) + 1; } -#endif returnPtr(tp->Strings[i]); } } |