lkml.org 
[lkml]   [2006]   [Jan]   [3]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Subject[PATCH 03/26] kconfig: lxdialog is now sparse clean
Date
From
From: Sam Ravnborg <sam@mars.ravnborg.org>
Date: 1132435075 +0100

Replacing a gcc idiom with malloc and deleting an unused global
variable made lxdialog sparse clean.

Signed-off-by: Sam Ravnborg <sam@ravnborg.org>

---

scripts/lxdialog/menubox.c | 5 +++--
scripts/lxdialog/util.c | 2 --
2 files changed, 3 insertions(+), 4 deletions(-)

a06104af7dcf2f5bafaf18f373c8b2554cbfe014
diff --git a/scripts/lxdialog/menubox.c b/scripts/lxdialog/menubox.c
index 260cc4d..ff3a617 100644
--- a/scripts/lxdialog/menubox.c
+++ b/scripts/lxdialog/menubox.c
@@ -67,7 +67,7 @@ static void print_item(WINDOW * win, con
int selected, int hotkey)
{
int j;
- char menu_item[menu_width + 1];
+ char *menu_item = malloc(menu_width + 1);

strncpy(menu_item, item, menu_width);
menu_item[menu_width] = 0;
@@ -95,6 +95,7 @@ static void print_item(WINDOW * win, con
wmove(win, choice, item_x + 1);
wrefresh(win);
}
+ free(menu_item);
}

/*
@@ -221,7 +222,7 @@ int dialog_menu(const char *title, const

/*
* Find length of longest item in order to center menu.
- * Set 'choice' to default item.
+ * Set 'choice' to default item.
*/
item_x = 0;
for (i = 0; i < item_no; i++) {
diff --git a/scripts/lxdialog/util.c b/scripts/lxdialog/util.c
index 1f84809..ce41147 100644
--- a/scripts/lxdialog/util.c
+++ b/scripts/lxdialog/util.c
@@ -26,8 +26,6 @@ bool use_colors = 1;

const char *backtitle = NULL;

-const char *dialog_result;
-
/*
* Attribute values, default is for mono display
*/
--
1.0.6
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2006-01-03 14:37    [W:0.127 / U:26.608 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site