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/compat-43/getwd.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/compat-43/getwd.c')
-rw-r--r-- | lib/libc/compat-43/getwd.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/libc/compat-43/getwd.c b/lib/libc/compat-43/getwd.c index e6f0d0053b7..f7bccc192fe 100644 --- a/lib/libc/compat-43/getwd.c +++ b/lib/libc/compat-43/getwd.c @@ -32,7 +32,7 @@ */ #if defined(LIBC_SCCS) && !defined(lint) -static char *rcsid = "$OpenBSD: getwd.c,v 1.4 1996/12/21 22:23:37 millert Exp $"; +static char *rcsid = "$OpenBSD: getwd.c,v 1.5 2001/06/27 00:58:53 lebel Exp $"; #endif /* LIBC_SCCS and not lint */ #include <sys/param.h> @@ -49,7 +49,6 @@ getwd(buf) if ((p = getcwd(buf, MAXPATHLEN))) return(p); - (void)strncpy(buf, strerror(errno), MAXPATHLEN-1); - buf[MAXPATHLEN-1] = '\0'; + strlcpy(buf, strerror(errno), MAXPATHLEN); return((char *)NULL); } |