diff --git a/cli-runopts.c b/cli-runopts.c
index 9c10fc363651ed299a0513dcd7aad8eaa2570bc6..986f830b836b9c464e2bd88b870ddc4fa2b1badb 100644
--- a/cli-runopts.c
+++ b/cli-runopts.c
@@ -90,6 +90,10 @@ static void printhelp() {
 					
 }
 
+/* Note that options that affect the transport or auth layers (such as -i or
+ * -W) should also be passed through to a multi-hop child proxycmd, in
+ * parse_multihop_hostname(). */
+
 void cli_getopts(int argc, char ** argv) {
 
 	unsigned int i, j;
@@ -469,9 +473,9 @@ static void parse_multihop_hostname(const char* orighostarg, const char* argv0)
 		if (cli_opts.remoteport == NULL) {
 			cli_opts.remoteport = "22";
 		}
-		cmd_len = strlen(remainder) 
+		cmd_len = strlen(argv0) + strlen(remainder) 
 			+ strlen(cli_opts.remotehost) + strlen(cli_opts.remoteport)
-			+ strlen(argv0) + 30;
+			+ 30;
 		cli_opts.proxycmd = m_malloc(cmd_len);
 		snprintf(cli_opts.proxycmd, cmd_len, "%s -B %s:%s %s", 
 				argv0, cli_opts.remotehost, cli_opts.remoteport, remainder);