20010628
 - (djm) Sync openbsd-compat with -current libc
diff --git a/openbsd-compat/dirname.c b/openbsd-compat/dirname.c
index c290826..a76a1dc 100644
--- a/openbsd-compat/dirname.c
+++ b/openbsd-compat/dirname.c
@@ -1,4 +1,4 @@
-/*	$OpenBSD: dirname.c,v 1.4 1999/05/30 17:10:30 espie Exp $	*/
+/*	$OpenBSD: dirname.c,v 1.5 2001/06/27 00:58:54 lebel Exp $	*/
 
 /*
  * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -31,7 +31,7 @@
 #ifndef HAVE_DIRNAME
 
 #if defined(LIBC_SCCS) && !defined(lint)
-static char rcsid[] = "$OpenBSD: dirname.c,v 1.4 1999/05/30 17:10:30 espie Exp $";
+static char rcsid[] = "$OpenBSD: dirname.c,v 1.5 2001/06/27 00:58:54 lebel Exp $";
 #endif /* LIBC_SCCS and not lint */
 
 #include <errno.h>
@@ -74,8 +74,7 @@
 		errno = ENAMETOOLONG;
 		return(NULL);
 	}
-	(void)strncpy(bname, path, endp - path + 1);
-	bname[endp - path + 1] = '\0';
+	strlcpy(bname, path, endp - path + 2);
 	return(bname);
 }
 #endif