summaryrefslogtreecommitdiffstats
path: root/src/godmode.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2009-01-26 08:27:10 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2009-01-26 08:27:10 +0100
commitb2e017d7b13c17b734bab48b84eb4ed1154c1a7c (patch)
tree14c529a7148d36aaa60efa8c8c7fce526fa57a06 /src/godmode.c
parentbb57e387728f840c5a88d12c3e42c9d9332fb0e1 (diff)
Remove redundant check
Diffstat (limited to 'src/godmode.c')
-rw-r--r--src/godmode.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/godmode.c b/src/godmode.c
index fe05b71..9f0368a 100644
--- a/src/godmode.c
+++ b/src/godmode.c
@@ -212,43 +212,31 @@ static int interface_part_bad_ncurses(disk_t *disk_car, list_part_t *list_part)
quit=1;
break;
case KEY_UP:
- if(list_part!=NULL)
+ if(pos->prev!=NULL)
{
- if(pos->prev!=NULL)
- {
- pos=pos->prev;
- pos_num--;
- }
+ pos=pos->prev;
+ pos_num--;
}
break;
case KEY_DOWN:
- if(list_part!=NULL)
+ if(pos->next!=NULL)
{
- if(pos->next!=NULL)
- {
- pos=pos->next;
- pos_num++;
- }
+ pos=pos->next;
+ pos_num++;
}
break;
case KEY_PPAGE:
- if(list_part!=NULL)
+ for(i=0; i<INTER_BAD_PART && pos->prev!=NULL; i++)
{
- for(i=0; i<INTER_BAD_PART && pos->prev!=NULL; i++)
- {
- pos=pos->prev;
- pos_num--;
- }
+ pos=pos->prev;
+ pos_num--;
}
break;
case KEY_NPAGE:
- if(list_part!=NULL)
+ for(i=0; i<INTER_BAD_PART && pos->next!=NULL; i++)
{
- for(i=0; i<INTER_BAD_PART && pos->next!=NULL; i++)
- {
- pos=pos->next;
- pos_num++;
- }
+ pos=pos->next;
+ pos_num++;
}
break;
default: