summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2003-03-17 21:57:58 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2003-03-17 21:57:58 +0000
commit4bd25e708cc1a39ad0f3d7f0dfbb62500ad878e2 (patch)
treedd6f4e7eb21098a57e944762b781876e5a52d353
parent6a036764bf0b066d2c7444f114099c2d13f3f132 (diff)
Deal with snprintf returning -1
-rw-r--r--lib/libcurses/tinfo/read_bsd_terminfo.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/lib/libcurses/tinfo/read_bsd_terminfo.c b/lib/libcurses/tinfo/read_bsd_terminfo.c
index f22e0205a4a..744954ce683 100644
--- a/lib/libcurses/tinfo/read_bsd_terminfo.c
+++ b/lib/libcurses/tinfo/read_bsd_terminfo.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read_bsd_terminfo.c,v 1.10 2002/02/16 21:27:26 millert Exp $ */
+/* $OpenBSD: read_bsd_terminfo.c,v 1.11 2003/03/17 21:57:57 millert Exp $ */
/*
* Copyright (c) 1998, 1999, 2000 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -28,7 +28,7 @@
*/
#ifndef lint
-static char rcsid[] = "$OpenBSD: read_bsd_terminfo.c,v 1.10 2002/02/16 21:27:26 millert Exp $";
+static char rcsid[] = "$OpenBSD: read_bsd_terminfo.c,v 1.11 2003/03/17 21:57:57 millert Exp $";
#endif
#include <curses.priv.h>
@@ -69,7 +69,7 @@ _nc_read_bsd_terminfo_entry(tn, filename, tp)
/* Also check $HOME/.terminfo if it exists */
if (use_terminfo_vars() && (p = getenv("HOME")) != NULL && *p != '\0') {
len = snprintf(hometerm, sizeof(hometerm), "%s/.terminfo", p);
- if (len < sizeof(hometerm))
+ if (len > 0 && len < sizeof(hometerm))
*fname++ = hometerm;
}