summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--bin/mt/mtrmt.c10
1 files changed, 3 insertions, 7 deletions
diff --git a/bin/mt/mtrmt.c b/bin/mt/mtrmt.c
index d7b9bcd7bf7..62d8839c31d 100644
--- a/bin/mt/mtrmt.c
+++ b/bin/mt/mtrmt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mtrmt.c,v 1.15 2004/09/16 08:35:49 deraadt Exp $ */
+/* $OpenBSD: mtrmt.c,v 1.16 2006/03/23 23:03:07 deraadt Exp $ */
/* $NetBSD: mtrmt.c,v 1.2 1996/03/06 06:22:07 scottr Exp $ */
/*-
@@ -87,12 +87,8 @@ static int rmtreply(char *);
int
rmthost(char *host)
{
- int len = strlen(host) + 1;
-
- rmtpeer = malloc(len);
- if (rmtpeer)
- strlcpy(rmtpeer, host, len);
- else
+ rmtpeer = strdup(host);
+ if (!rmtpeer)
rmtpeer = host;
signal(SIGPIPE, sigrmtconnaborted);
rmtgetconn();