summaryrefslogtreecommitdiffstats
path: root/mdk-stage1
diff options
context:
space:
mode:
authorAntoine Ginies <aginies@mandriva.com>2011-04-07 09:59:14 +0000
committerAntoine Ginies <aginies@mandriva.com>2011-04-07 09:59:14 +0000
commitcaad4f295489eddb27cb3098b706797342f3b9cc (patch)
treef4c9f258a6bc6c49afc162e12c10d896fbcd8d4d /mdk-stage1
parent21b8eb3229911df0b7d3663d74055162d2dd3070 (diff)
downloaddrakx-caad4f295489eddb27cb3098b706797342f3b9cc.tar
drakx-caad4f295489eddb27cb3098b706797342f3b9cc.tar.gz
drakx-caad4f295489eddb27cb3098b706797342f3b9cc.tar.bz2
drakx-caad4f295489eddb27cb3098b706797342f3b9cc.tar.xz
drakx-caad4f295489eddb27cb3098b706797342f3b9cc.zip
fix build problem (operation on 'li->startShowItem' may be undefined'
Diffstat (limited to 'mdk-stage1')
-rw-r--r--mdk-stage1/newt/listbox.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/mdk-stage1/newt/listbox.c b/mdk-stage1/newt/listbox.c
index cdbf792ca..e2141fff0 100644
--- a/mdk-stage1/newt/listbox.c
+++ b/mdk-stage1/newt/listbox.c
@@ -648,12 +648,13 @@ static struct eventResult listboxEvent(newtComponent co, struct event ev) {
}
if (item) {
li->currItem = i;
- if(li->currItem < li->startShowItem ||
- li->currItem > li->startShowItem)
- li->startShowItem =
- li->currItem > li->numItems - li->curHeight ?
- li->startShowItem = li->numItems - li->curHeight :
- li->currItem;
+ if(li->currItem < li->startShowItem || li->currItem > li->startShowItem) {
+ if (li->currItem > li->numItems - li->curHeight) {
+ li->startShowItem= li->numItems - li->curHeight;
+ } else {
+ li->startShowItem = li->currItem;
+ }
+ }
if(li->sb)
newtScrollbarSet(li->sb, li->currItem + 1, li->numItems);
newtListboxRealSetCurrent(co);