summaryrefslogtreecommitdiff
path: root/openbsd-compat/dirname.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2001-06-28 14:48:28 +1000
committerDamien Miller <djm@mindrot.org>2001-06-28 14:48:28 +1000
commit180207ffe1a54bb15d10ce54fdc854b8dcd0511f (patch)
treecb5a7d07cd28ff08c26f163112d33b7ded283ff6 /openbsd-compat/dirname.c
parent315f8b70b0e255fd7c2222794631d233569ce22b (diff)
20010628
- (djm) Sync openbsd-compat with -current libc
Diffstat (limited to 'openbsd-compat/dirname.c')
-rw-r--r--openbsd-compat/dirname.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/openbsd-compat/dirname.c b/openbsd-compat/dirname.c
index c2908267..a76a1dc1 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 @@ dirname(path)
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