summaryrefslogtreecommitdiffstats
path: root/lib/libcurses/tinfo/comp_error.c
diff options
context:
space:
mode:
authormillert <millert@openbsd.org>2003-03-18 16:55:54 +0000
committermillert <millert@openbsd.org>2003-03-18 16:55:54 +0000
commit9149fa9137a24429e1289bda9567cc12d988bd46 (patch)
tree9105ce28a5d8f3aa02daed6c6aff6bdc7fdaaf1e /lib/libcurses/tinfo/comp_error.c
parentDo not .Xr yourself, you old bugger. Come on. Give us a grin. (diff)
downloadwireguard-openbsd-9149fa9137a24429e1289bda9567cc12d988bd46.tar.xz
wireguard-openbsd-9149fa9137a24429e1289bda9567cc12d988bd46.zip
Use strlcpy() / strlcat() throughout.
Diffstat (limited to 'lib/libcurses/tinfo/comp_error.c')
-rw-r--r--lib/libcurses/tinfo/comp_error.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/libcurses/tinfo/comp_error.c b/lib/libcurses/tinfo/comp_error.c
index 13d427c9379..13259e1efc4 100644
--- a/lib/libcurses/tinfo/comp_error.c
+++ b/lib/libcurses/tinfo/comp_error.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: comp_error.c,v 1.4 2001/01/22 18:05:43 millert Exp $ */
+/* $OpenBSD: comp_error.c,v 1.5 2003/03/18 16:55:54 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998,1999,2000 Free Software Foundation, Inc. *
@@ -62,15 +62,16 @@ _nc_set_source(const char *const name)
NCURSES_EXPORT(void)
_nc_set_type(const char *const name)
{
- termtype[0] = '\0';
if (name)
- strncat(termtype, name, sizeof(termtype) - 1);
+ strlcpy(termtype, name, sizeof(termtype));
+ else
+ termtype[0] = '\0';
}
NCURSES_EXPORT(void)
_nc_get_type(char *name)
{
- strcpy(name, termtype);
+ strlcpy(name, termtype, MAX_NAME_SIZE + 1);
}
static inline void