summaryrefslogtreecommitdiff
path: root/usr.bin/tmux/cmd-refresh-client.c
diff options
context:
space:
mode:
authorNicholas Marriott <nicm@cvs.openbsd.org>2020-05-20 06:18:23 +0000
committerNicholas Marriott <nicm@cvs.openbsd.org>2020-05-20 06:18:23 +0000
commit6dfc41fda8a0dc9f0e6f7d6dbf10fd8f7e6a0374 (patch)
tree043c91a4c249b93135626b913a218ff5b987a6bb /usr.bin/tmux/cmd-refresh-client.c
parent32c66456df37b84360355ff1b46d25dd0e7a7abb (diff)
Remove a redundant if statement.
Diffstat (limited to 'usr.bin/tmux/cmd-refresh-client.c')
-rw-r--r--usr.bin/tmux/cmd-refresh-client.c38
1 files changed, 18 insertions, 20 deletions
diff --git a/usr.bin/tmux/cmd-refresh-client.c b/usr.bin/tmux/cmd-refresh-client.c
index dcbc9e282fb..943b5c07003 100644
--- a/usr.bin/tmux/cmd-refresh-client.c
+++ b/usr.bin/tmux/cmd-refresh-client.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: cmd-refresh-client.c,v 1.33 2020/05/16 15:45:29 nicm Exp $ */
+/* $OpenBSD: cmd-refresh-client.c,v 1.34 2020/05/20 06:18:22 nicm Exp $ */
/*
* Copyright (c) 2007 Nicholas Marriott <nicholas.marriott@gmail.com>
@@ -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);
}