comparison cli-main.c @ 568:005530560594

Rearrange getaddrstring() etc
author Matt Johnston <matt@ucc.asn.au>
date Tue, 01 Sep 2009 16:38:26 +0000
parents 9e51707cd6f2
children a98a2138364a
comparison
equal deleted inserted replaced
567:893a9dd0b9dd 568:005530560594
43 int main(int argc, char ** argv) { 43 int main(int argc, char ** argv) {
44 #endif 44 #endif
45 45
46 int sock_in, sock_out; 46 int sock_in, sock_out;
47 char* error = NULL; 47 char* error = NULL;
48 char* hostandport;
49 int len;
50 48
51 _dropbear_exit = cli_dropbear_exit; 49 _dropbear_exit = cli_dropbear_exit;
52 _dropbear_log = cli_dropbear_log; 50 _dropbear_log = cli_dropbear_log;
53 51
54 disallow_core(); 52 disallow_core();
76 74
77 if (sock_in < 0) { 75 if (sock_in < 0) {
78 dropbear_exit("%s", error); 76 dropbear_exit("%s", error);
79 } 77 }
80 78
81 /* Set up the host:port log */ 79 cli_session(sock_in, sock_out);
82 len = strlen(cli_opts.remotehost);
83 len += 10; /* 16 bit port and leeway*/
84 hostandport = (char*)m_malloc(len);
85 snprintf(hostandport, len, "%s:%s",
86 cli_opts.remotehost, cli_opts.remoteport);
87
88 cli_session(sock_in, sock_out, hostandport);
89 80
90 /* not reached */ 81 /* not reached */
91 return -1; 82 return -1;
92 } 83 }
93 #endif /* DBMULTI stuff */ 84 #endif /* DBMULTI stuff */