summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authornicm <nicm@openbsd.org>2009-08-13 12:15:45 +0000
committernicm <nicm@openbsd.org>2009-08-13 12:15:45 +0000
commit1f2f8f5165f4250103a120ae4b2c705316ed2303 (patch)
tree04648fff45f6fcea5c490d636a3842e3796f8fe6
parentset ITSDONE on the xs before calling scsi_done() (diff)
downloadwireguard-openbsd-1f2f8f5165f4250103a120ae4b2c705316ed2303.tar.xz
wireguard-openbsd-1f2f8f5165f4250103a120ae4b2c705316ed2303.zip
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@.
-rw-r--r--usr.bin/tmux/server-msg.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/usr.bin/tmux/server-msg.c b/usr.bin/tmux/server-msg.c
index 23e51c8bebb..a317971b287 100644
--- a/usr.bin/tmux/server-msg.c
+++ b/usr.bin/tmux/server-msg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: server-msg.c,v 1.13 2009/08/11 21:28:11 nicm Exp $ */
+/* $OpenBSD: server-msg.c,v 1.14 2009/08/13 12:15:45 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicm@users.sourceforge.net>
@@ -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';