summaryrefslogtreecommitdiffstats
path: root/src/hiddenn.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2010-05-21 09:17:55 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2010-05-21 09:17:55 +0200
commit76dffac4ca51aa1e79130a3c4752a429e3a086e0 (patch)
tree82764e9e113bda707960315128f12fcb160e55e7 /src/hiddenn.c
parent21d47fea5168186938a4187055afe1d4d042977e (diff)
Another fix for DCO/HPA detection
Diffstat (limited to 'src/hiddenn.c')
-rw-r--r--src/hiddenn.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/hiddenn.c b/src/hiddenn.c
index 2e45343..5931fc0 100644
--- a/src/hiddenn.c
+++ b/src/hiddenn.c
@@ -69,12 +69,13 @@ int interface_check_hidden_ncurses(disk_t *disk)
wmove(stdscr,line++,0);
wprintw(stdscr, "dco %llu sectors\n", (long long unsigned)(disk->dco+1));
}
- if(disk->user_max < disk->native_max+1)
+ if(disk->user_max > 0 && disk->user_max < disk->native_max+1)
{
wmove(stdscr,line++,0);
wprintw(stdscr, "Host Protected Area (HPA) present.\n");
}
- if(disk->native_max!=0 && disk->native_max < disk->dco)
+ if((disk->native_max > 0 && disk->user_max < disk->native_max+1 && disk->native_max < disk->dco) ||
+ (disk->user_max > 0 && disk->user_max < disk->dco+1))
{
wmove(stdscr,line,0);
wprintw(stdscr, "Device Configuration Overlay (DCO) present.\n");