170 |
char *argv[]; |
char *argv[]; |
171 |
{ |
{ |
172 |
char *host; |
char *host; |
173 |
short port; |
int port; |
174 |
|
|
175 |
if (connected) { |
if (connected) { |
176 |
printf("Already connected to %s, use close first.\n", |
printf("Already connected to %s, use close first.\n", |
188 |
port = sp->s_port; |
port = sp->s_port; |
189 |
if (argc > 2) { |
if (argc > 2) { |
190 |
port = atoi(argv[2]); |
port = atoi(argv[2]); |
191 |
if (port <= 0) { |
if (port <= 0 || port > 65535 ) { |
192 |
printf("%s: bad port number-- %s\n", argv[1], argv[2]); |
printf("%s: bad port number-- %s\n", argv[1], argv[2]); |
193 |
printf ("usage: %s host-name [port]\n", argv[0]); |
printf ("usage: %s host-name [port]\n", argv[0]); |
194 |
code = -1; |
code = -1; |