summaryrefslogtreecommitdiffstats
path: root/lib/libc/gen/confstr.c
diff options
context:
space:
mode:
authorlebel <lebel@openbsd.org>2001-06-27 00:58:53 +0000
committerlebel <lebel@openbsd.org>2001-06-27 00:58:53 +0000
commitf1a075da3e4bb4f84a5bb83783c6b1943dc3da49 (patch)
treef3b98ca6be26aa2b00a7770f1dceff5312265655 /lib/libc/gen/confstr.c
parentKeep track of the ACQUIRE sequence number, and pass it to the kernel (diff)
downloadwireguard-openbsd-f1a075da3e4bb4f84a5bb83783c6b1943dc3da49.tar.xz
wireguard-openbsd-f1a075da3e4bb4f84a5bb83783c6b1943dc3da49.zip
use strlcpy vs strncpy+a[len-1]='\0'. millert@ ok.
Diffstat (limited to 'lib/libc/gen/confstr.c')
-rw-r--r--lib/libc/gen/confstr.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/gen/confstr.c b/lib/libc/gen/confstr.c
index cb25deed19a..90fbcc5330d 100644
--- a/lib/libc/gen/confstr.c
+++ b/lib/libc/gen/confstr.c
@@ -32,7 +32,7 @@
*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: confstr.c,v 1.3 1996/09/15 09:30:55 tholo Exp $";
+static char rcsid[] = "$OpenBSD: confstr.c,v 1.4 2001/06/27 00:58:54 lebel Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
@@ -73,8 +73,7 @@ confstr(name, buf, len)
* POSIX 1003.2 requires partial return of
* the string -- that should be *real* useful.
*/
- (void)strncpy(buf, p, len - 1);
- buf[len - 1] = '\0';
+ strlcpy(buf, p, len);
free(p);
}
return (tlen + 1);