diff cli-runopts.c @ 415:8b9aba1d5fa4 channel-fix

merge of '73fe066c5d9e2395354ba74756124d45c978a04d' and 'f5014cc84558f1e8eba42dbecf9f72f94bfe6134'
author Matt Johnston <matt@ucc.asn.au>
date Tue, 06 Feb 2007 16:00:18 +0000
parents 47bcc3536bd5
children ab57ba0cb667
line wrap: on
line diff
--- a/cli-runopts.c	Tue Feb 06 15:59:54 2007 +0000
+++ b/cli-runopts.c	Tue Feb 06 16:00:18 2007 +0000
@@ -363,7 +363,8 @@
 
 	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 @@
 		TRACE(("connectaddr == NULL"))
 		goto fail;
 	}
-
-	connectaddr[0] = '\0';
+	*connectaddr = '\0';
 	connectaddr++;
 
 	connectport = strchr(connectaddr, ':');
@@ -382,8 +382,7 @@
 		TRACE(("connectport == NULL"))
 		goto fail;
 	}
-
-	connectport[0] = '\0';
+	*connectport = '\0';
 	connectport++;
 
 	newfwd = (struct TCPFwdList*)m_malloc(sizeof(struct TCPFwdList));