summaryrefslogtreecommitdiffstats
path: root/gnu/lib/libdialog
diff options
context:
space:
mode:
authorimp <imp@FreeBSD.org>1999-04-25 22:14:06 +0000
committerimp <imp@FreeBSD.org>1999-04-25 22:14:06 +0000
commit35d2979599d0ad7a7aaf62f3d59fc099119b76d3 (patch)
tree8197f7fbf0f9e55d804711e8b4bf3553635cb376 /gnu/lib/libdialog
parent107cc59b3636d12d04ae2db934ee05542418eaa8 (diff)
downloadFreeBSD-src-35d2979599d0ad7a7aaf62f3d59fc099119b76d3.zip
FreeBSD-src-35d2979599d0ad7a7aaf62f3d59fc099119b76d3.tar.gz
Use braces to avoid potentially ambiguous else clause.
main's return type is int not void. Reviewed by: obrien and chuckr
Diffstat (limited to 'gnu/lib/libdialog')
-rw-r--r--gnu/lib/libdialog/menubox.c3
-rw-r--r--gnu/lib/libdialog/tree.c6
2 files changed, 6 insertions, 3 deletions
diff --git a/gnu/lib/libdialog/menubox.c b/gnu/lib/libdialog/menubox.c
index 73d004a..9a5b0c2 100644
--- a/gnu/lib/libdialog/menubox.c
+++ b/gnu/lib/libdialog/menubox.c
@@ -259,7 +259,7 @@ draw:
else
i = choice - 1;
}
- else if (KEY_IS_DOWN(key))
+ else if (KEY_IS_DOWN(key)) {
if (choice == max_choice - 1) {
if (scroll + choice < item_no - 1) {
/* Scroll menu up */
@@ -285,6 +285,7 @@ draw:
}
else
i = choice + 1;
+ }
if (i != choice) {
/* De-highlight current item */
diff --git a/gnu/lib/libdialog/tree.c b/gnu/lib/libdialog/tree.c
index e48f134..43c7399 100644
--- a/gnu/lib/libdialog/tree.c
+++ b/gnu/lib/libdialog/tree.c
@@ -315,7 +315,7 @@ int dialog_treemenu(unsigned char *title, unsigned char *prompt,
else
i = choice - 1;
}
- else if (key == KEY_DOWN || key == '+')
+ else if (key == KEY_DOWN || key == '+') {
if (choice == max_choice - 1) {
if (scroll+choice < item_no-1) {
#ifdef BROKEN_WSCRL
@@ -352,6 +352,7 @@ int dialog_treemenu(unsigned char *title, unsigned char *prompt,
}
else
i = choice + 1;
+ }
if (i != choice) {
/* De-highlight current item */
@@ -987,7 +988,7 @@ mk_tree(unsigned char **names, int size, unsigned char FS,
in_string = name = names[i];
while(*in_string)
{
- if (*in_string == FS)
+ if (*in_string == FS) {
if (!i && !*(in_string + 1))
name = in_string;
else
@@ -995,6 +996,7 @@ mk_tree(unsigned char **names, int size, unsigned char FS,
shift++;
name = in_string + 1;
}
+ }
in_string++;
}
array[i].name = name;
OpenPOWER on IntegriCloud