From: simon Date: Thu, 1 Feb 2001 14:09:00 +0000 (+0000) Subject: Ignore the zero byte at the start of the rlogin main protocol X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/commitdiff_plain/8a5fb9e347cb5f1f80cd1f6511afe2dfff7516dd Ignore the zero byte at the start of the rlogin main protocol git-svn-id: svn://svn.tartarus.org/sgt/putty@920 cda61777-01e9-0310-a592-d414129be87e --- diff --git a/rlogin.c b/rlogin.c index 9ce73095..e20b9e68 100644 --- a/rlogin.c +++ b/rlogin.c @@ -49,8 +49,22 @@ static int rlogin_receive (Socket skt, int urgent, char *data, int len) { * on 0x10 and 0x20 respectively. I'm not convinced it's * worth it... */ + } else { + /* + * Main rlogin protocol. This is really simple: the first + * byte is expected to be NULL and is ignored, and the rest + * is printed. + */ + static int firstbyte = 1; + if (firstbyte) { + if (data[0] == '\0') { + data++; + len--; + } + firstbyte = 0; + } + c_write(data, len); } - c_write(data, len); return 1; }