summaryrefslogtreecommitdiff
path: root/lib/libfetch
diff options
context:
space:
mode:
authorBrian Somers <brian@FreeBSD.org>2001-08-20 12:50:21 +0000
committerBrian Somers <brian@FreeBSD.org>2001-08-20 12:50:21 +0000
commit2449bf28adca16e49c811264b39a8727e46caf53 (patch)
treec1fa3343ede9a1d367c7206b7d1a5e349de54cc1 /lib/libfetch
parentb1743630356c4ef54abb3ea67c92c4dc116a4f9f (diff)
Notes
Diffstat (limited to 'lib/libfetch')
-rw-r--r--lib/libfetch/ftp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libfetch/ftp.c b/lib/libfetch/ftp.c
index f1ffbf2dda0a..127401920526 100644
--- a/lib/libfetch/ftp.c
+++ b/lib/libfetch/ftp.c
@@ -744,7 +744,8 @@ _ftp_authenticate(int cd, struct url *url, struct url *purl)
if (!pwd || !*pwd) {
if ((logname = getlogin()) == 0)
logname = FTP_ANONYMOUS_USER;
- len = snprintf(pbuf, MAXLOGNAME + 1, "%s@", logname);
+ if ((len = snprintf(pbuf, MAXLOGNAME + 1, "%s@", logname)) == -1)
+ len = 0;
gethostname(pbuf + len, sizeof pbuf - len);
pwd = pbuf;
}