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
67 int selected, int hotkey)67 int selected, int hotkey)
68{68{
69 int j;69 int j;
70 char menu_item[menu_width + 1];70 char *menu_item = malloc(menu_width + 1);
71 71
72 strncpy(menu_item, item, menu_width);72 strncpy(menu_item, item, menu_width);
73 menu_item[menu_width] = 0;73 menu_item[menu_width] = 0;
@@ -95,6 +95,7 @@ static void print_item(WINDOW * win, const char *item, int choice, · 21 unmodified lines
95 wmove(win, choice, item_x + 1);95 wmove(win, choice, item_x + 1);
96 wrefresh(win);96 wrefresh(win);
97 }97 }
98 free(menu_item);
98}99}
99 100
100/*101/*
@@ -221,7 +222,7 @@ int dialog_menu(const char *title, const char *prompt, int height, int width, · 120 unmodified lines
221 222
222 /*223 /*
223 * Find length of longest item in order to center menu.224 * Find length of longest item in order to center menu.
224 * Set 'choice' to default item. 225 * Set 'choice' to default item.
225 */226 */
226 item_x = 0;227 item_x = 0;
227 for (i = 0; i < item_no; i++) {228 for (i = 0; i < item_no; i++) {
scripts/lxdialog/util.c+0−2
@@ -26,8 +26,6 @@ bool use_colors = 1; · 25 unmodified lines
26 26
27const char *backtitle = NULL;27const char *backtitle = NULL;
28 28
29const char *dialog_result;
30
31/*29/*
32 * Attribute values, default is for mono display30 * Attribute values, default is for mono display
33 */31 */

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