diff --git a/lib/libc/compat-43/getwd.c b/lib/libc/compat-43/getwd.c index 668dae07ada..280236e522e 100644 --- a/lib/libc/compat-43/getwd.c +++ b/lib/libc/compat-43/getwd.c @@ -41,16 +41,14 @@ __FBSDID("$FreeBSD$"); #include #include #include -#include char * -getwd(buf) - char *buf; +getwd(char *buf) { char *p; if ( (p = getcwd(buf, MAXPATHLEN)) ) return(p); - (void)strcpy(buf, strerror(errno)); + (void)strerror_r(errno, buf, MAXPATHLEN); return((char *)NULL); }