buf = dupprintf("Looking up host \"%s\"", host);
buf = dupprintf("Looking up host \"%s\"%s", host, (cfg->addressfamily == ADDRTYPE_IPV4 ? " (IPv4)" : (cfg->addressfamily == ADDRTYPE_IPV6 ? " (IPv6)" : "")));
static const char *telnet_init(void *frontend_handle, void **backend_handle,			       Config *cfg,			       char *host, int port, char **realhost,			       int nodelay, int keepalive){    static const struct plug_function_table fn_table = {	telnet_closing,	telnet_receive,	telnet_sent    };    SockAddr addr;    const char *err;    Telnet telnet;    telnet = snew(struct telnet_tag);    telnet->fn = &fn_table;    telnet->cfg = *cfg;		       /* STRUCTURE COPY */    telnet->s = NULL;    telnet->echoing = TRUE;    telnet->editing = TRUE;    telnet->activated = FALSE;    telnet->sb_buf = NULL;    telnet->sb_size = 0;    telnet->frontend = frontend_handle;    telnet->term_width = telnet->cfg.width;    telnet->term_height = telnet->cfg.height;    telnet->state = TOP_LEVEL;    telnet->ldisc = NULL;    telnet->pinger = NULL;    *backend_handle = telnet;    /*     * Try to find host.     */    {	char *buf;	buf = dupprintf("Looking up host \"%s\"", host);	logevent(telnet->frontend, buf);	sfree(buf);    }    addr = name_lookup(host, port, realhost, &telnet->cfg);    if ((err = sk_addr_error(addr)) != NULL) {	sk_addr_free(addr);	return err;    }    if (port < 0)	port = 23;		       /* default telnet port */    /*     * Open socket.     */    {	char *buf, addrbuf[100];	sk_getaddr(addr, addrbuf, 100);	buf = dupprintf("Connecting to %s port %d", addrbuf, port);	logevent(telnet->frontend, buf);	sfree(buf);    }    telnet->s = new_connection(addr, *realhost, port, 0, 1,			       nodelay, keepalive, (Plug) telnet, &telnet->cfg);    if ((err = sk_socket_error(telnet->s)) != NULL)	return err;    telnet->pinger = pinger_new(&telnet->cfg, &telnet_backend, telnet);    /*     * Initialise option states.     */    if (telnet->cfg.passive_telnet) {	const struct Opt *const *o;	for (o = opts; *o; o++)	    telnet->opt_states[(*o)->index] = INACTIVE;    } else {	const struct Opt *const *o;	for (o = opts; *o; o++) {	    telnet->opt_states[(*o)->index] = (*o)->initial_state;	    if (telnet->opt_states[(*o)->index] == REQUESTED)		send_opt(telnet, (*o)->send, (*o)->option);	}	telnet->activated = TRUE;    }    /*     * Set up SYNCH state.     */    telnet->in_synch = FALSE;    /*     * We can send special commands from the start.     */    update_specials_menu(telnet->frontend);    return NULL;}