[PATCH] mode-tree: correct missing braces around else

8 views
Skip to first unread message

Thomas Adam

unread,
May 12, 2019, 1:57:44 PM5/12/19
to tmux-...@googlegroups.com, Thomas Adam
For mode_tree_display_menu() there's two conditions at the same
indentation of an else statement, without surrounding braces. Clang
blows a gasket, and we should rightly fix it.
---
mode-tree.c | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/mode-tree.c b/mode-tree.c
index eb642826..1add48e2 100644
--- a/mode-tree.c
+++ b/mode-tree.c
@@ -808,7 +808,7 @@ static void
mode_tree_display_menu(struct mode_tree_data *mtd, struct client *c, u_int x,
u_int y, int outside)
{
- struct mode_tree_item *mti;
+ struct mode_tree_item *mti = NULL;
struct menu *menu;
struct mode_tree_menu *mtm;
const char *s;
@@ -817,9 +817,10 @@ mode_tree_display_menu(struct mode_tree_data *mtd, struct client *c, u_int x,

if (mtd->offset + y > mtd->line_size - 1)
line = mtd->current;
- else
+ else {
line = mtd->offset + y;
mti = mtd->line_list[line].item;
+ }

if (!outside) {
s = mtd->menu;
--
2.20.1

Nicholas Marriott

unread,
May 12, 2019, 2:17:01 PM5/12/19
to Thomas Adam, tmux-...@googlegroups.com
Fixed, thanks - the indentation is wrong, not the brackets.
> --
> You received this message because you are subscribed to the Google Groups "tmux-users" group.
> To unsubscribe from this group and stop receiving emails from it, send an email to tmux-users+...@googlegroups.com.
> To post to this group, send an email to tmux-...@googlegroups.com.
> To view this discussion on the web, visit https://groups.google.com/d/msgid/tmux-users/20190512175735.10869-1-thomas%40xteddy.org.
> For more options, visit https://groups.google.com/d/optout.
Reply all
Reply to author
Forward
0 new messages