summaryrefslogtreecommitdiff
path: root/openbsd-compat/dirname.c
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2002-02-13 16:00:15 +1100
committerDamien Miller <djm@mindrot.org>2002-02-13 16:00:15 +1100
commit8e3bdca1da7d30542e9028f35f2a1cef052c85e4 (patch)
tree4c05c79248820c0c128db51a2cd2c74220cd66e8 /openbsd-compat/dirname.c
parent3db5f530d0fdf8044d6014ab12940efe0bbecca7 (diff)
- (djm) Sync openbsd-compat with OpenBSD CVS too
Diffstat (limited to 'openbsd-compat/dirname.c')
-rw-r--r--openbsd-compat/dirname.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/openbsd-compat/dirname.c b/openbsd-compat/dirname.c
index a76a1dc13..391b2dd81 100644
--- a/openbsd-compat/dirname.c
+++ b/openbsd-compat/dirname.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: dirname.c,v 1.5 2001/06/27 00:58:54 lebel Exp $ */ 1/* $OpenBSD: dirname.c,v 1.6 2001/06/28 04:27:19 pjanzen Exp $ */
2 2
3/* 3/*
4 * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com> 4 * Copyright (c) 1997 Todd C. Miller <Todd.Miller@courtesan.com>
@@ -31,7 +31,7 @@
31#ifndef HAVE_DIRNAME 31#ifndef HAVE_DIRNAME
32 32
33#if defined(LIBC_SCCS) && !defined(lint) 33#if defined(LIBC_SCCS) && !defined(lint)
34static char rcsid[] = "$OpenBSD: dirname.c,v 1.5 2001/06/27 00:58:54 lebel Exp $"; 34static char rcsid[] = "$OpenBSD: dirname.c,v 1.6 2001/06/28 04:27:19 pjanzen Exp $";
35#endif /* LIBC_SCCS and not lint */ 35#endif /* LIBC_SCCS and not lint */
36 36
37#include <errno.h> 37#include <errno.h>
@@ -70,7 +70,7 @@ dirname(path)
70 } while (endp > path && *endp == '/'); 70 } while (endp > path && *endp == '/');
71 } 71 }
72 72
73 if (endp - path + 1 > sizeof(bname)) { 73 if (endp - path + 2 > sizeof(bname)) {
74 errno = ENAMETOOLONG; 74 errno = ENAMETOOLONG;
75 return(NULL); 75 return(NULL);
76 } 76 }