diff options
author | 2001-06-27 00:58:53 +0000 | |
---|---|---|
committer | 2001-06-27 00:58:53 +0000 | |
commit | f1a075da3e4bb4f84a5bb83783c6b1943dc3da49 (patch) | |
tree | f3b98ca6be26aa2b00a7770f1dceff5312265655 /lib/libc/gen/confstr.c | |
parent | Keep track of the ACQUIRE sequence number, and pass it to the kernel (diff) | |
download | wireguard-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.c | 5 |
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); |