printf("usage: %s host-name [port]\n", argv[0]);
printf("usage: %s [host] [port]\n", argv[0]);
setpeer(int argc, char *argv[]){	struct hostent *host;	if (argc < 2) {		strlcpy(line, "Connect ", sizeof line);		printf("(to) ");		fgets(&line[strlen(line)], LBUFLEN-strlen(line), stdin);		if (makeargv())			return;		argc = margc;		argv = margv;	}	if ((argc < 2) || (argc > 3)) {		printf("usage: %s host-name [port]\n", argv[0]);		return;	}	if (inet_aton(argv[1], &peeraddr.sin_addr) != 0) {		peeraddr.sin_family = AF_INET;		(void) strncpy(hostname, argv[1], sizeof hostname);		hostname[sizeof(hostname)-1] = '\0';	} else {		host = gethostbyname(argv[1]);		if (host == 0) {			connected = 0;			printf("%s: unknown host\n", argv[1]);			return;		}		peeraddr.sin_family = host->h_addrtype;		bcopy(host->h_addr, &peeraddr.sin_addr, host->h_length);		(void) strlcpy(hostname, host->h_name, sizeof hostname);	}	port = sp->s_port;	if (argc == 3) {		port = atoi(argv[2]);		if (port < 0) {			printf("%s: bad port number\n", argv[2]);			connected = 0;			return;		}		port = htons(port);	}	connected = 1;}