diff options
author | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-03-23 23:03:08 +0000 |
---|---|---|
committer | Theo de Raadt <deraadt@cvs.openbsd.org> | 2006-03-23 23:03:08 +0000 |
commit | 6345f3856d8c2e681e6f6e61a51ccd24c210a884 (patch) | |
tree | 4665ced5353e12aa3c131dc24203341283b96404 /bin/mt/mtrmt.c | |
parent | 2e2523f866435a0a3c6fa35848139715f6b36436 (diff) |
use strdup() instead; adobriyan@gmail
Diffstat (limited to 'bin/mt/mtrmt.c')
-rw-r--r-- | bin/mt/mtrmt.c | 10 |
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(); |