*/
#if defined(LIBC_SCCS) && !defined(lint)
-static char *rcsid = "$OpenBSD: getwd.c,v 1.2 1996/08/19 08:19:24 tholo Exp $";
+static char *rcsid = "$OpenBSD: getwd.c,v 1.3 1996/12/17 02:38:39 deraadt Exp $";
#endif /* LIBC_SCCS and not lint */
#include <sys/param.h>
if (p = getcwd(buf, MAXPATHLEN))
return(p);
- (void)strcpy(buf, strerror(errno));
+ (void)strncpy(buf, strerror(errno), MAXPATHLEN-1);
+ buf[MAXPATHLEN-1] = '\0';
return((char *)NULL);
}