aboutsummaryrefslogtreecommitdiffstats
path: root/sway/commands/swap.c
diff options
context:
space:
mode:
authorLibravatar sghctoma <sghctoma@gmail.com>2018-11-08 13:57:04 +0100
committerLibravatar sghctoma <sghctoma@gmail.com>2018-11-08 13:57:04 +0100
commit7ead20bfcfbc3785d471944f4631b0144fdedeba (patch)
treef81b4308292ba8944d50c1c8cda473c3e789a424 /sway/commands/swap.c
parentMerge pull request #3087 from RedSoxFan/side-gaps (diff)
downloadsway-7ead20bfcfbc3785d471944f4631b0144fdedeba.tar.gz
sway-7ead20bfcfbc3785d471944f4631b0144fdedeba.tar.zst
sway-7ead20bfcfbc3785d471944f4631b0144fdedeba.zip
Fix building with clang
The "struct sway_container *other" variable in swap.c was potentially used uninitialized, depending on an "if" statement.
Diffstat (limited to 'sway/commands/swap.c')
-rw-r--r--sway/commands/swap.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sway/commands/swap.c b/sway/commands/swap.c
index 23e8d583..99051395 100644
--- a/sway/commands/swap.c
+++ b/sway/commands/swap.c
@@ -181,7 +181,7 @@ struct cmd_results *cmd_swap(int argc, char **argv) {
181 } 181 }
182 182
183 struct sway_container *current = config->handler_context.container; 183 struct sway_container *current = config->handler_context.container;
184 struct sway_container *other; 184 struct sway_container *other = NULL;
185 185
186 char *value = join_args(argv + 3, argc - 3); 186 char *value = join_args(argv + 3, argc - 3);
187 if (strcasecmp(argv[2], "id") == 0) { 187 if (strcasecmp(argv[2], "id") == 0) {