From 7503c141089a5d50d35b3d0ccfbca5c43bf0e8d3 Mon Sep 17 00:00:00 2001 From: Christophe Grenier Date: Sat, 8 Aug 2020 12:25:56 +0200 Subject: [PATCH] recover_MD_from_partition(): Constify local variable offset --- src/md.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/md.c b/src/md.c index 2f43bc69..993fb200 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;