summaryrefslogtreecommitdiffstats
path: root/src/next.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/next.c
parentcc3bc11be8d37123b2165510fe510c8ca5944385 (diff)
Store disk geometry in cylinders/heads_per_cylinder/sectors_per_head instead of CHS
Diffstat (limited to 'src/next.c')
-rw-r--r--src/next.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/next.c b/src/next.c
index 47e8437..757f3d7 100644
--- a/src/next.c
+++ b/src/next.c
@@ -50,7 +50,8 @@ static unsigned int search_location_nbr=0;
static search_location_t search_location_info[SEARCH_LOCATION_MAX];
static inline uint64_t CHS_to_offset(const unsigned int C, const int H, const int S,const disk_t *disk_car)
-{ return (((uint64_t)C*(disk_car->CHS.head+1)+H)*disk_car->CHS.sector+(S>0?S-1:S))*disk_car->sector_size;
+{
+ return (((uint64_t)C * disk_car->geom.heads_per_cylinder + H) * disk_car->geom.sectors_per_head +(S>0?S-1:S))*disk_car->sector_size;
}
void search_location_init(const disk_t *disk_car, const unsigned int location_boundary, const int fast_mode, const int search_vista_part)