From 7a005b91b373aad3cfa877081b1df9c8d52f1d58 Mon Sep 17 00:00:00 2001 From: Nicholas Marriott Date: Thu, 13 Aug 2009 12:15:45 +0000 Subject: [PATCH] If the client passes zero for the window size in the identify message (which it can, for example on serial terminals), reset it to 80x25, same as for resize messages. Problem reported by kettenis@. --- server-msg.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/server-msg.c b/server-msg.c index 286e8bdc..e8aea526 100644 --- a/server-msg.c +++ b/server-msg.c @@ -238,7 +238,11 @@ void server_msg_identify(struct client *c, struct msg_identify_data *data, int fd) { c->tty.sx = data->sx; + if (c->tty.sx == 0) + c->tty.sx = 80; c->tty.sy = data->sy; + if (c->tty.sy == 0) + c->tty.sy = 25; c->cwd = NULL; data->cwd[(sizeof data->cwd) - 1] = '\0';