summaryrefslogtreecommitdiffstats
path: root/cmd-refresh-client.c
diff options
context:
space:
mode:
authornicm <nicm>2020-05-20 06:18:22 +0000
committernicm <nicm>2020-05-20 06:18:22 +0000
commitb53e60f4c6d1e16dab996a58bb3ebd14691c2922 (patch)
tree50573f6677025fc4c714171e54b40c5cbda53214 /cmd-refresh-client.c
parent2a9e2b556a310366c69f8a72e1c20ed0392f11fd (diff)
Remove a redundant if statement.
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);
}