diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-04-21 00:12:21 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2005-04-21 00:12:21 +0000 |
commit | 586259d0716ace494e2ee64d7b25fb0089521aec (patch) | |
tree | fc08ebe023ce331985cc8bdd2dc79d240df4c0b4 /libexec/ftpd/ftpd.c | |
parent | be35d93f938f1839db1c6b73858fa7aa6d4a5b95 (diff) |
make code prettier so we can tell it is safe when we read it; ok beck cloder
Diffstat (limited to 'libexec/ftpd/ftpd.c')
-rw-r--r-- | libexec/ftpd/ftpd.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/libexec/ftpd/ftpd.c b/libexec/ftpd/ftpd.c index 01343111b28..3641aba9848 100644 --- a/libexec/ftpd/ftpd.c +++ b/libexec/ftpd/ftpd.c @@ -1,4 +1,4 @@ -/* $OpenBSD: ftpd.c,v 1.163 2005/03/15 12:22:58 niallo Exp $ */ +/* $OpenBSD: ftpd.c,v 1.164 2005/04/21 00:12:20 deraadt Exp $ */ /* $NetBSD: ftpd.c,v 1.15 1995/06/03 22:46:47 mycroft Exp $ */ /* @@ -70,7 +70,7 @@ static const char copyright[] = static const char sccsid[] = "@(#)ftpd.c 8.4 (Berkeley) 4/16/94"; #else static const char rcsid[] = - "$OpenBSD: ftpd.c,v 1.163 2005/03/15 12:22:58 niallo Exp $"; + "$OpenBSD: ftpd.c,v 1.164 2005/04/21 00:12:20 deraadt Exp $"; #endif #endif /* not lint */ @@ -2799,15 +2799,16 @@ logxfer(char *name, off_t size, time_t start) strvis(vremotehost, remotehost, VIS_SAFE|VIS_NOSLASH); strvis(vpw, guest? guestpw : pw->pw_name, VIS_SAFE|VIS_NOSLASH); - if ((len = snprintf(buf, sizeof(buf), + len = snprintf(buf, sizeof(buf), "%.24s %d %s %qd %s %c %s %c %c %s ftp %d %s %s\n", ctime(&now), now - start + (now == start), vremotehost, (long long)size, vpath, ((type == TYPE_A) ? 'a' : 'b'), "*" /* none yet */, 'o', ((guest) ? 'a' : 'r'), vpw, 0 /* none yet */, - ((guest) ? "*" : pw->pw_name), dhostname)) >= sizeof(buf) - || len < 0) { + ((guest) ? "*" : pw->pw_name), dhostname); + + if (len >= sizeof(buf) || len == -1) { if ((len = strlen(buf)) == 0) return; /* should not happen */ buf[len - 1] = '\n'; |