aboutsummaryrefslogtreecommitdiff
path: root/cmd-refresh-client.c
diff options
context:
space:
mode:
authorThomas Adam <thomas@xteddy.org>2020-05-20 08:01:18 +0100
committerThomas Adam <thomas@xteddy.org>2020-05-20 08:01:18 +0100
commitfa835339fdc9a5647cd90549840029c480edbf90 (patch)
treed591769ea8f658979d5b3e465aeb7604954a59f5 /cmd-refresh-client.c
parentfb9e53ba19a59359ac56fa5e0b9ef59694f7b705 (diff)
parentb53e60f4c6d1e16dab996a58bb3ebd14691c2922 (diff)
downloadrtmux-fa835339fdc9a5647cd90549840029c480edbf90.tar.gz
rtmux-fa835339fdc9a5647cd90549840029c480edbf90.tar.bz2
rtmux-fa835339fdc9a5647cd90549840029c480edbf90.zip
Merge branch 'obsd-master'
Diffstat (limited to 'cmd-refresh-client.c')
-rw-r--r--cmd-refresh-client.c36
1 files changed, 17 insertions, 19 deletions
diff --git a/cmd-refresh-client.c b/cmd-refresh-client.c
index c53a6a78..d31bd2cc 100644
--- a/cmd-refresh-client.c
+++ b/cmd-refresh-client.c
@@ -113,26 +113,24 @@ cmd_refresh_client_exec(struct cmd *self, struct cmdq_item *item)
server_client_set_flags(tc, args_get(args, 'f'));
if (args_has(args, 'C')) {
- if (args_has(args, 'C')) {
- if (!(tc->flags & CLIENT_CONTROL)) {
- cmdq_error(item, "not a control client");
- return (CMD_RETURN_ERROR);
- }
- size = args_get(args, 'C');
- if (sscanf(size, "%u,%u", &x, &y) != 2 &&
- sscanf(size, "%ux%u", &x, &y) != 2) {
- cmdq_error(item, "bad size argument");
- return (CMD_RETURN_ERROR);
- }
- if (x < WINDOW_MINIMUM || x > WINDOW_MAXIMUM ||
- y < WINDOW_MINIMUM || y > WINDOW_MAXIMUM) {
- cmdq_error(item, "size too small or too big");
- return (CMD_RETURN_ERROR);
- }
- tty_set_size(&tc->tty, x, y, 0, 0);
- tc->flags |= CLIENT_SIZECHANGED;
- recalculate_sizes();
+ if (~tc->flags & CLIENT_CONTROL) {
+ cmdq_error(item, "not a control client");
+ return (CMD_RETURN_ERROR);
+ }
+ size = args_get(args, 'C');
+ if (sscanf(size, "%u,%u", &x, &y) != 2 &&
+ sscanf(size, "%ux%u", &x, &y) != 2) {
+ cmdq_error(item, "bad size argument");
+ return (CMD_RETURN_ERROR);
+ }
+ if (x < WINDOW_MINIMUM || x > WINDOW_MAXIMUM ||
+ y < WINDOW_MINIMUM || y > WINDOW_MAXIMUM) {
+ cmdq_error(item, "size too small or too big");
+ return (CMD_RETURN_ERROR);
}
+ tty_set_size(&tc->tty, x, y, 0, 0);
+ tc->flags |= CLIENT_SIZECHANGED;
+ recalculate_sizes();
return (CMD_RETURN_NORMAL);
}