summaryrefslogtreecommitdiffstats
path: root/package/config/lxdialog/checklist.c
diff options
context:
space:
mode:
authorPeter Korsgaard <jacmet@sunsite.dk>2010-09-02 17:08:11 +0200
committerPeter Korsgaard <jacmet@sunsite.dk>2010-09-02 17:08:11 +0200
commite62ed84b19d114870daf1f16aae177f60f9d6ad3 (patch)
tree9b3471d639525410bd65e36c5e5aa94b77c29a28 /package/config/lxdialog/checklist.c
parent9bc12b85e83266c83f1fee0b9dd2d38e43d9252c (diff)
parent40177240fab04c710fd756a24816b451b37dc1b8 (diff)
downloadbuildroot-novena-e62ed84b19d114870daf1f16aae177f60f9d6ad3.tar.gz
buildroot-novena-e62ed84b19d114870daf1f16aae177f60f9d6ad3.zip
Merge branch 'for-2010.11/kconfig-upgrade' of git://git.busybox.net/~tpetazzoni/git/buildroot
Diffstat (limited to 'package/config/lxdialog/checklist.c')
-rw-r--r--package/config/lxdialog/checklist.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/package/config/lxdialog/checklist.c b/package/config/lxdialog/checklist.c
index bcc6f19c3..a2eb80fbc 100644
--- a/package/config/lxdialog/checklist.c
+++ b/package/config/lxdialog/checklist.c
@@ -31,6 +31,10 @@ static int list_width, check_x, item_x;
static void print_item(WINDOW * win, int choice, int selected)
{
int i;
+ char *list_item = malloc(list_width + 1);
+
+ strncpy(list_item, item_str(), list_width - item_x);
+ list_item[list_width - item_x] = '\0';
/* Clear 'residue' of last item */
wattrset(win, dlg.menubox.atr);
@@ -45,13 +49,14 @@ static void print_item(WINDOW * win, int choice, int selected)
wprintw(win, "(%c)", item_is_tag('X') ? 'X' : ' ');
wattrset(win, selected ? dlg.tag_selected.atr : dlg.tag.atr);
- mvwaddch(win, choice, item_x, item_str()[0]);
+ mvwaddch(win, choice, item_x, list_item[0]);
wattrset(win, selected ? dlg.item_selected.atr : dlg.item.atr);
- waddstr(win, (char *)item_str() + 1);
+ waddstr(win, list_item + 1);
if (selected) {
wmove(win, choice, check_x + 1);
wrefresh(win);
}
+ free(list_item);
}
/*
@@ -175,6 +180,7 @@ do_resize:
check_x = 0;
item_foreach()
check_x = MAX(check_x, strlen(item_str()) + 4);
+ check_x = MIN(check_x, list_width);
check_x = (list_width - check_x) / 2;
item_x = check_x + 4;