summaryrefslogtreecommitdiff
path: root/libexec/ftpd/ftpd.c
diff options
context:
space:
mode:
authorTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-29 07:00:59 +0000
committerTheo de Raadt <deraadt@cvs.openbsd.org>1998-12-29 07:00:59 +0000
commitfe36d17905d17020e052ad49baee3785381bc26f (patch)
tree7614cfbcfb0a55853fdcce27654959b4b0df6cec /libexec/ftpd/ftpd.c
parent9ac5bb3f9168e072413a3340af81bd2802b6d34c (diff)
use getcwd()
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r--libexec/ftpd/ftpd.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c
index a14c5e0bdea..00cc3634279 100644
--- a/libexec/ftpd/ftpd.c
+++ b/libexec/ftpd/ftpd.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ftpd.c,v 1.50 1998/11/18 23:30:08 deraadt Exp $ */
+/* $OpenBSD: ftpd.c,v 1.51 1998/12/29 07:00:58 deraadt Exp $ */
/* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */
/*
@@ -231,9 +231,9 @@ void logxfer __P((char *, off_t, time_t));
static char *
curdir()
{
- static char path[MAXPATHLEN+1+1]; /* path + '/' + '\0' */
+ static char path[MAXPATHLEN+1]; /* path + '/' */
- if (getcwd(path, sizeof(path)-2) == NULL)
+ if (getcwd(path, sizeof(path)-1) == NULL)
return ("");
if (path[1] != '\0') /* special case for root dir. */
strcat(path, "/");
@@ -1719,9 +1719,9 @@ removedir(name)
void
pwd()
{
- char path[MAXPATHLEN + 1];
+ char path[MAXPATHLEN];
- if (getwd(path) == (char *)NULL)
+ if (getcwd(path, sizeof path) == (char *)NULL)
reply(550, "%s.", path);
else
replydirname(path, "is current directory.");