summaryrefslogtreecommitdiffstats
path: root/scripts
diff options
context:
space:
mode:
authorSam Ravnborg <sam@neptun.ravnborg.org>2006-09-02 22:01:42 +0200
committerSam Ravnborg <sam@neptun.ravnborg.org>2006-09-30 11:19:20 +0200
commit737ecae264bc759e2033d99e99138f690f3beabf (patch)
tree55193f039f5ddfe55b391bbaecca308671532ae2 /scripts
parentc29121b787f533d135ae47b5f3044adb66cbebef (diff)
kconfig/lxdialog: clear long menu lines
Menulines that were wider than the available line width is now properly null terminated. While at it renamed the variable choice => line_y so it better reflect the usage in do_print_item(). Signed-off-by: Sam Ravnborg <sam@ravnborg.org>
Diffstat (limited to 'scripts')
-rw-r--r--scripts/kconfig/lxdialog/menubox.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/scripts/kconfig/lxdialog/menubox.c b/scripts/kconfig/lxdialog/menubox.c
index fcd95a985328..0d83159d9012 100644
--- a/scripts/kconfig/lxdialog/menubox.c
+++ b/scripts/kconfig/lxdialog/menubox.c
@@ -63,19 +63,19 @@ static int menu_width, item_x;
/*
* Print menu item
*/
-static void do_print_item(WINDOW * win, const char *item, int choice,
+static void do_print_item(WINDOW * win, const char *item, int line_y,
int selected, int hotkey)
{
int j;
char *menu_item = malloc(menu_width + 1);
strncpy(menu_item, item, menu_width - item_x);
- menu_item[menu_width] = 0;
+ menu_item[menu_width - item_x] = '\0';
j = first_alpha(menu_item, "YyNnMmHh");
/* Clear 'residue' of last item */
wattrset(win, dlg.menubox.atr);
- wmove(win, choice, 0);
+ wmove(win, line_y, 0);
#if OLD_NCURSES
{
int i;
@@ -86,14 +86,14 @@ static void do_print_item(WINDOW * win, const char *item, int choice,
wclrtoeol(win);
#endif
wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr);
- mvwaddstr(win, choice, item_x, menu_item);
+ mvwaddstr(win, line_y, item_x, menu_item);
if (hotkey) {
wattrset(win, selected ? dlg.tag_key_selected.atr
: dlg.tag_key.atr);
- mvwaddch(win, choice, item_x + j, menu_item[j]);
+ mvwaddch(win, line_y, item_x + j, menu_item[j]);
}
if (selected) {
- wmove(win, choice, item_x + 1);
+ wmove(win, line_y, item_x + 1);
}
free(menu_item);
wrefresh(win);
ec9b43c47e3'>logstatsplain -rw-r--r--bugs.h397logstatsplain -rw-r--r--byteorder.h830logstatsplain -rw-r--r--cache.h756logstatsplain -rw-r--r--cacheflush.h1557logstatsplain -rw-r--r--checksum.h2101logstatsplain -rw-r--r--compat.h4359logstatsplain -rw-r--r--cpu.h417logstatsplain -rw-r--r--cputime.h115logstatsplain -rw-r--r--current.h379logstatsplain -rw-r--r--cyclone.h403logstatsplain -rw-r--r--delay.h1895logstatsplain -rw-r--r--div64.h31logstatsplain -rw-r--r--dma-mapping.h2279logstatsplain -rw-r--r--dma.h406logstatsplain -rw-r--r--elf.h10740logstatsplain -rw-r--r--emergency-restart.h149logstatsplain -rw-r--r--errno.h31logstatsplain -rw-r--r--fcntl.h294logstatsplain -rw-r--r--fpswa.h1886logstatsplain -rw-r--r--fpu.h2206logstatsplain -rw-r--r--futex.h1153logstatsplain -rw-r--r--gcc_intrin.h17896logstatsplain -rw-r--r--hardirq.h790logstatsplain -rw-r--r--hw_irq.h4333logstatsplain -rw-r--r--ia32.h1208logstatsplain -rw-r--r--ia64regs.h2812logstatsplain -rw-r--r--ide.h1430logstatsplain -rw-r--r--intel_intrin.h8550logstatsplain -rw-r--r--intrinsics.h5355logstatsplain -rw-r--r--io.h12816logstatsplain -rw-r--r--ioctl.h2657logstatsplain -rw-r--r--ioctls.h2723logstatsplain -rw-r--r--iosapic.h2980logstatsplain -rw-r--r--ipcbuf.h582logstatsplain -rw-r--r--irq.h1004logstatsplain