diff options
author | Dag-Erling Smørgrav <des@FreeBSD.org> | 2005-06-05 15:41:57 +0000 |
---|---|---|
committer | Dag-Erling Smørgrav <des@FreeBSD.org> | 2005-06-05 15:41:57 +0000 |
commit | 4518870c7202d4098a97eae7a1d3820d84a4b0f4 (patch) | |
tree | 08ccf47ce923e292d8f5057f36d34f042b7a5e6d /crypto/openssh/scp.c | |
parent | 5e8dbd04ef7b2df5ba3f8dc859ad6e472ce1c534 (diff) | |
download | src-test2-4518870c7202d4098a97eae7a1d3820d84a4b0f4.tar.gz src-test2-4518870c7202d4098a97eae7a1d3820d84a4b0f4.zip |
Notes
Diffstat (limited to 'crypto/openssh/scp.c')
-rw-r--r-- | crypto/openssh/scp.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/crypto/openssh/scp.c b/crypto/openssh/scp.c index f69fd05fc66f..1d34cc63938a 100644 --- a/crypto/openssh/scp.c +++ b/crypto/openssh/scp.c @@ -71,7 +71,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: scp.c,v 1.119 2005/01/24 10:22:06 dtucker Exp $"); +RCSID("$OpenBSD: scp.c,v 1.121 2005/04/02 12:41:16 djm Exp $"); #include "xmalloc.h" #include "atomicio.h" @@ -361,20 +361,21 @@ void toremote(char *targ, int argc, char **argv) { int i, len; - char *bp, *host, *src, *suser, *thost, *tuser; + char *bp, *host, *src, *suser, *thost, *tuser, *arg; *targ++ = 0; if (*targ == 0) targ = "."; - if ((thost = strrchr(argv[argc - 1], '@'))) { + arg = xstrdup(argv[argc - 1]); + if ((thost = strrchr(arg, '@'))) { /* user@host */ *thost++ = 0; - tuser = argv[argc - 1]; + tuser = arg; if (*tuser == '\0') tuser = NULL; } else { - thost = argv[argc - 1]; + thost = arg; tuser = NULL; } |