summaryrefslogtreecommitdiff
path: root/lib/libcurses/read_termcap.c
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1998-10-31 06:30:32 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1998-10-31 06:30:32 +0000
commit6b2a1c68ae261f9418c63985441e14381a10cd12 (patch)
tree4ae6e697e6a9c43cbe1974319f6b1f7854838e02 /lib/libcurses/read_termcap.c
parent774a90a035f055fa6dcf304c080c05bf13a095ca (diff)
update to ncurses 4.2-981017
Diffstat (limited to 'lib/libcurses/read_termcap.c')
-rw-r--r--lib/libcurses/read_termcap.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/lib/libcurses/read_termcap.c b/lib/libcurses/read_termcap.c
index bd6da55add1..f2da7081f69 100644
--- a/lib/libcurses/read_termcap.c
+++ b/lib/libcurses/read_termcap.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: read_termcap.c,v 1.5 1998/10/08 04:20:00 millert Exp $ */
+/* $OpenBSD: read_termcap.c,v 1.6 1998/10/31 06:30:31 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -63,7 +63,7 @@
#include <fcntl.h>
#endif
-MODULE_ID("$From: read_termcap.c,v 1.35 1998/08/18 01:37:53 tom Exp $")
+MODULE_ID("$From: read_termcap.c,v 1.37 1998/09/19 21:42:14 tom Exp $")
#ifndef PURE_TERMINFO
@@ -1012,11 +1012,14 @@ int _nc_read_termcap_entry(const char *const tn, TERMTYPE *const tp)
else
ADD_TC("/usr/share/misc/termcap", filecount);
- if (!issetugid() && (h = getenv("HOME")) != NULL && strlen(h) + 9 < PATH_MAX)
+#define PRIVATE_CAP "%s/.termcap"
+
+ if (!issetugid() && (h = getenv("HOME")) != NULL
+ && (strlen(h) + sizeof(PRIVATE_CAP)) < PATH_MAX)
{
/* user's .termcap, if any, should override it */
(void) strcpy(envhome, h);
- (void) sprintf(pathbuf, "%s/.termcap", envhome);
+ (void) sprintf(pathbuf, PRIVATE_CAP, envhome);
ADD_TC(pathbuf, filecount);
}
}