summaryrefslogtreecommitdiffstats
path: root/usr.bin/ftp
diff options
context:
space:
mode:
authorshin <shin@FreeBSD.org>2000-02-24 19:01:38 +0000
committershin <shin@FreeBSD.org>2000-02-24 19:01:38 +0000
commitd693ba6b01e780960fb9d14ccf0ac6b6e383aa8e (patch)
tree89fc4a5c24f8961c8b42c172dc2f5056cd3c07a9 /usr.bin/ftp
parentef025b40abfbf8549aa93743f5197893d1fa8bb4 (diff)
downloadFreeBSD-src-d693ba6b01e780960fb9d14ccf0ac6b6e383aa8e.zip
FreeBSD-src-d693ba6b01e780960fb9d14ccf0ac6b6e383aa8e.tar.gz
Correctly print out "Connected to" hostname.
Temporal buffer was used for the hostname and freed before actually used. Specified by: ru Approved by: jkh
Diffstat (limited to 'usr.bin/ftp')
-rw-r--r--usr.bin/ftp/ftp.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/usr.bin/ftp/ftp.c b/usr.bin/ftp/ftp.c
index 3617376..d374fdd 100644
--- a/usr.bin/ftp/ftp.c
+++ b/usr.bin/ftp/ftp.c
@@ -134,10 +134,9 @@ hookup(host0, port)
}
res = res0;
- if (res->ai_canonname)
- hostname = res->ai_canonname;
- else {
- (void) strncpy(hostnamebuf, host, sizeof(hostnamebuf));
+ if (res->ai_canonname) {
+ (void) strncpy(hostnamebuf, res->ai_canonname,
+ sizeof(hostnamebuf));
hostname = hostnamebuf;
}
while (1) {
OpenPOWER on IntegriCloud