History

kconfig: lxdialog is now sparse clean

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

Sam Ravnborg committed 21 years ago

Commit a06104a1 parent dec69da2 files · +3 −4Browse files

Showing the changes to scripts (2 of 2 files). Show all

Unified · Split

2 files
  1. scripts/lxdialog/menubox.c +3 −2
  2. scripts/lxdialog/util.c +0 −2
scripts/lxdialog/menubox.c+3−2
@@ -67,7 +67,7 @@ static void print_item(WINDOW * win, const char *item, int choice, · 66 unmodified lines
6767 int selected, int hotkey)
6868 {
6969 int j;
70− char menu_item[menu_width + 1];
70+ char *menu_item = malloc(menu_width + 1);
7171
7272 strncpy(menu_item, item, menu_width);
7373 menu_item[menu_width] = 0;
@@ -95,6 +95,7 @@ static void print_item(WINDOW * win, const char *item, int choice, · 21 unmodified lines
9595 wmove(win, choice, item_x + 1);
9696 wrefresh(win);
9797 }
98+ free(menu_item);
9899 }
99100
100101 /*
@@ -221,7 +222,7 @@ int dialog_menu(const char *title, const char *prompt, int height, int width, · 120 unmodified lines
221222
222223 /*
223224 * Find length of longest item in order to center menu.
224− * Set 'choice' to default item.
225+ * Set 'choice' to default item.
225226 */
226227 item_x = 0;
227228 for (i = 0; i < item_no; i++) {
scripts/lxdialog/util.c+0−2
@@ -26,8 +26,6 @@ bool use_colors = 1; · 25 unmodified lines
2626
2727 const char *backtitle = NULL;
2828
29−const char *dialog_result;
30−
3129 /*
3230 * Attribute values, default is for mono display
3331 */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t