diff options
author | Matt Johnston <matt@ucc.asn.au> | 2007-02-06 16:00:18 +0000 |
---|---|---|
committer | Matt Johnston <matt@ucc.asn.au> | 2007-02-06 16:00:18 +0000 |
commit | cda7af7ca2fe9fb8d848e7891a528e63531a4e8d (patch) | |
tree | 936cdb192e15a456a67d52ab439841b4610404c2 /cli-runopts.c | |
parent | d199e0b1196f39509a92e31d6843193d828bcfab (diff) | |
parent | b1217873364b9c6aa974462b466a795f224249f3 (diff) |
merge of '73fe066c5d9e2395354ba74756124d45c978a04d'
and 'f5014cc84558f1e8eba42dbecf9f72f94bfe6134'
--HG--
branch : channel-fix
extra : convert_revision : cc6095ce978e5f9e51ece6f1717499bc73594bcc
Diffstat (limited to 'cli-runopts.c')
-rw-r--r-- | cli-runopts.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/cli-runopts.c b/cli-runopts.c index 7a672da..1a077b9 100644 --- a/cli-runopts.c +++ b/cli-runopts.c @@ -363,7 +363,8 @@ static void addforward(char* origstr, struct TCPFwdList** fwdlist) { TRACE(("enter addforward")) - /* We probably don't want to be editing argvs */ + /* We need to split the original argument up. This var + is never free()d. */ str = m_strdup(origstr); listenport = str; @@ -373,8 +374,7 @@ static void addforward(char* origstr, struct TCPFwdList** fwdlist) { TRACE(("connectaddr == NULL")) goto fail; } - - connectaddr[0] = '\0'; + *connectaddr = '\0'; connectaddr++; connectport = strchr(connectaddr, ':'); @@ -382,8 +382,7 @@ static void addforward(char* origstr, struct TCPFwdList** fwdlist) { TRACE(("connectport == NULL")) goto fail; } - - connectport[0] = '\0'; + *connectport = '\0'; connectport++; newfwd = (struct TCPFwdList*)m_malloc(sizeof(struct TCPFwdList)); |