summaryrefslogtreecommitdiffstats
path: root/src/edit.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2008-07-18 22:16:08 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2008-07-18 22:16:08 +0200
commit8585ef8e51b492783c7d4a3125beeacac1d4314a (patch)
treeec8cbc98265f903e2ca2063b78f93eb3c358ad23 /src/edit.c
parentcc3bc11be8d37123b2165510fe510c8ca5944385 (diff)
Store disk geometry in cylinders/heads_per_cylinder/sectors_per_head instead of CHS
Diffstat (limited to 'src/edit.c')
-rw-r--r--src/edit.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/edit.c b/src/edit.c
index 21adbf4..be53ad2 100644
--- a/src/edit.c
+++ b/src/edit.c
@@ -149,7 +149,7 @@ static void interface_editor_position(const disk_t *disk_car,uint64_t *lba)
mvwaddstr(stdscr,INTER_GEOM_Y, INTER_GEOM_X, "Enter the number of cylinders: ");
if (get_string(response, LINE_LENGTH, def) > 0) {
tmp_val = atoi(response);
- if (tmp_val <= disk_car->CHS.cylinder) {
+ if (tmp_val < disk_car->geom.cylinders) {
position.cylinder = tmp_val;
} else
wprintw(stdscr,"Illegal cylinders value");
@@ -161,7 +161,7 @@ static void interface_editor_position(const disk_t *disk_car,uint64_t *lba)
mvwaddstr(stdscr,INTER_GEOM_Y, INTER_GEOM_X, "Enter the number of heads: ");
if (get_string(response, LINE_LENGTH, def) > 0) {
tmp_val = atoi(response);
- if (tmp_val <= disk_car->CHS.head) {
+ if (tmp_val < disk_car->geom.heads_per_cylinder) {
position.head = tmp_val;
} else
wprintw(stdscr,"Illegal heads value");
@@ -173,7 +173,7 @@ static void interface_editor_position(const disk_t *disk_car,uint64_t *lba)
mvwaddstr(stdscr,INTER_GEOM_Y, INTER_GEOM_X, "Enter the number of sectors per track: ");
if (get_string(response, LINE_LENGTH, def) > 0) {
tmp_val = atoi(response);
- if (tmp_val > 0 && tmp_val <= disk_car->CHS.sector ) {
+ if (tmp_val > 0 && tmp_val <= disk_car->geom.sectors_per_head ) {
position.sector = tmp_val;
} else
wprintw(stdscr,"Illegal sectors value");