diff options
Diffstat (limited to 'common/menutree.c')
-rw-r--r-- | common/menutree.c | 25 |
1 files changed, 4 insertions, 21 deletions
diff --git a/common/menutree.c b/common/menutree.c index 400d1a6939..751350d754 100644 --- a/common/menutree.c +++ b/common/menutree.c @@ -1,13 +1,4 @@ -/* - * This program is free software; you can redistribute it and/or modify - * it under the terms of the GNU General Public License version 2 - * as published by the Free Software Foundation. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ +// SPDX-License-Identifier: GPL-2.0-only #include <environment.h> #include <libbb.h> @@ -43,14 +34,7 @@ static void menutree_action(struct menu *m, struct menu_entry *me) static void setenv_bool(const char *var, bool val) { - const char *str; - - if (val) - str = "1"; - else - str = "0"; - - setenv(var, str); + pr_setenv(var, "%d", val); } static void menutree_box(struct menu *m, struct menu_entry *me) @@ -93,10 +77,9 @@ int menutree(const char *path, int toplevel) struct stat s; char *box; struct menutree *mt; - glob_t g; + glob_t g = {}; int i; char *globpath, *display; - size_t size; menu = menu_alloc(); @@ -109,7 +92,7 @@ int menutree(const char *path, int toplevel) } globpath = basprintf("%s/title", path); - display = read_file(globpath, &size); + display = read_file(globpath, NULL); free(globpath); if (!display) { eprintf("no title found in %s/title\n", path); |