summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2020-08-08 12:25:56 +0200
committerChristophe Grenier <grenier@cgsecurity.org>2020-08-08 12:25:56 +0200
commit7503c141089a5d50d35b3d0ccfbca5c43bf0e8d3 (patch)
tree06008a756945f6dda329e49d5e692c8545ae39bb
parent470032570176e47ab193ed7c31a3297c571394b1 (diff)
recover_MD_from_partition(): Constify local variable offset
-rw-r--r--src/md.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/md.c b/src/md.c
index 2f43bc6..993fb20 100644
--- a/src/md.c
+++ b/src/md.c
@@ -337,7 +337,7 @@ int recover_MD_from_partition(disk_t *disk_car, partition_t *partition, const in
unsigned char *buffer=(unsigned char*)MALLOC(MD_SB_BYTES);
/* MD version 0.90 */
{
- uint64_t offset=MD_NEW_SIZE_SECTORS(partition->part_size/512)*512;
+ const uint64_t offset=MD_NEW_SIZE_SECTORS(partition->part_size/512)*512;
if(disk_car->pread(disk_car, buffer, MD_SB_BYTES, partition->part_offset + offset) == MD_SB_BYTES)
{
if(recover_MD(disk_car,(struct mdp_superblock_s*)buffer,partition,verbose,0)==0)
@@ -350,7 +350,7 @@ int recover_MD_from_partition(disk_t *disk_car, partition_t *partition, const in
/* MD version 1.0 */
if(partition->part_size > 8*2*512)
{
- uint64_t offset=(((partition->part_size/512)-8*2) & ~(4*2-1))*512;
+ const uint64_t offset=(((partition->part_size/512)-8*2) & ~(4*2-1))*512;
if(disk_car->pread(disk_car, buffer, MD_SB_BYTES, partition->part_offset + offset) == MD_SB_BYTES)
{
const struct mdp_superblock_1 *sb1=(const struct mdp_superblock_1 *)buffer;