diff options
author | 2003-04-05 16:06:01 +0000 | |
---|---|---|
committer | 2003-04-05 16:06:01 +0000 | |
commit | e803f734602642633e19a99fe84f3355ebbc7a86 (patch) | |
tree | 9b48a8b57f4265582fa5010dc0d9164712e6796d | |
parent | strlcpy; ok matthieu henning miod (diff) | |
download | wireguard-openbsd-e803f734602642633e19a99fe84f3355ebbc7a86.tar.xz wireguard-openbsd-e803f734602642633e19a99fe84f3355ebbc7a86.zip |
correct a bad strncpy; replace with strlcat; rohee@ ok
-rw-r--r-- | usr.sbin/pkg_install/lib/str.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/usr.sbin/pkg_install/lib/str.c b/usr.sbin/pkg_install/lib/str.c index 1d8518c61e5..f6294699b7c 100644 --- a/usr.sbin/pkg_install/lib/str.c +++ b/usr.sbin/pkg_install/lib/str.c @@ -1,7 +1,7 @@ -/* $OpenBSD: str.c,v 1.8 2003/04/05 10:42:19 avsm Exp $ */ +/* $OpenBSD: str.c,v 1.9 2003/04/05 16:06:01 avsm Exp $ */ #ifndef lint -static const char *rcsid = "$OpenBSD: str.c,v 1.8 2003/04/05 10:42:19 avsm Exp $"; +static const char *rcsid = "$OpenBSD: str.c,v 1.9 2003/04/05 16:06:01 avsm Exp $"; #endif /* @@ -66,10 +66,9 @@ strconcat(char *s1, char *s2) { static char tmp[FILENAME_MAX]; - tmp[0] = '\0'; - strncpy(tmp, s1 ? s1 : s2, FILENAME_MAX); + strlcpy(tmp, s1 ? s1 : s2, sizeof(tmp)); if (s1 && s2) - strncat(tmp, s2, FILENAME_MAX - strlen(tmp)); + strlcat(tmp, s2, sizeof(tmp)); return tmp; } |