rlogin->firstbyte = 1;
static char *rlogin_init(void *frontend_handle, void **backend_handle,			 Config *cfg,			 char *host, int port, char **realhost, int nodelay){    static const struct plug_function_table fn_table = {	rlogin_closing,	rlogin_receive,	rlogin_sent    };    SockAddr addr;    char *err;    Rlogin rlogin;    rlogin = smalloc(sizeof(*rlogin));    rlogin->fn = &fn_table;    rlogin->s = NULL;    rlogin->frontend = frontend_handle;    rlogin->term_width = cfg->width;    rlogin->term_height = cfg->height;    *backend_handle = rlogin;    /*     * Try to find host.     */    {	char *buf;	buf = dupprintf("Looking up host \"%s\"", host);	logevent(rlogin->frontend, buf);	sfree(buf);    }    addr = name_lookup(host, port, realhost, cfg);    if ((err = sk_addr_error(addr)) != NULL)	return err;    if (port < 0)	port = 513;		       /* default rlogin port */    /*     * Open socket.     */    {	char *buf, addrbuf[100];	sk_getaddr(addr, addrbuf, 100);	buf = dupprintf("Connecting to %s port %d", addrbuf, port);	logevent(rlogin->frontend, buf);	sfree(buf);    }    rlogin->s = new_connection(addr, *realhost, port, 1, 0,			       nodelay, (Plug) rlogin, cfg);    if ((err = sk_socket_error(rlogin->s)) != NULL)	return err;    sk_addr_free(addr);    /*     * Send local username, remote username, terminal/speed     */    {	char z = 0;	char *p;	sk_write(rlogin->s, &z, 1);	sk_write(rlogin->s, cfg->localusername,		 strlen(cfg->localusername));	sk_write(rlogin->s, &z, 1);	sk_write(rlogin->s, cfg->username,		 strlen(cfg->username));	sk_write(rlogin->s, &z, 1);	sk_write(rlogin->s, cfg->termtype,		 strlen(cfg->termtype));	sk_write(rlogin->s, "/", 1);	for (p = cfg->termspeed; isdigit(*p); p++) continue;	sk_write(rlogin->s, cfg->termspeed, p - cfg->termspeed);	rlogin->bufsize = sk_write(rlogin->s, &z, 1);    }    return NULL;}