summaryrefslogtreecommitdiffstats
path: root/src/exfat.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:01:13 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2016-01-23 10:01:13 +0100
commit0919ba08e99b2be59f564e9b980f3efda422bf4b (patch)
tree304cd68826fafe04ee0dd226fffa5671f77a7515 /src/exfat.c
parent417520c82da29f2197d779fc47ed48e3c9a6f41f (diff)
New prototype for test_EXFAT()
Diffstat (limited to 'src/exfat.c')
-rw-r--r--src/exfat.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/src/exfat.c b/src/exfat.c
index 9e7ddf2..62cf983 100644
--- a/src/exfat.c
+++ b/src/exfat.c
@@ -50,15 +50,15 @@ int exfat_read_cluster(disk_t *disk, const partition_t *partition, const struct
partition->part_offset + exfat_cluster_to_offset(exfat_header, cluster));
}
-static int set_EXFAT_info(partition_t *partition, const struct exfat_super_block*exfat_header)
+static void set_EXFAT_info(partition_t *partition, const struct exfat_super_block*exfat_header)
{
+ partition->upart_type=UP_EXFAT;
partition->blocksize=1<<(exfat_header->block_per_clus_bits + exfat_header->blocksize_bits);
partition->fsname[0]='\0';
if(partition->sb_offset==0)
snprintf(partition->info, sizeof(partition->info), "exFAT, blocksize=%u", partition->blocksize);
else
snprintf(partition->info, sizeof(partition->info), "exFAT found using backup sector, blocksize=%u", partition->blocksize);
- return 0;
}
int check_EXFAT(disk_t *disk, partition_t *partition)
@@ -69,7 +69,7 @@ int check_EXFAT(disk_t *disk, partition_t *partition)
free(buffer);
return 1;
}
- if(test_EXFAT((struct exfat_super_block*)buffer, partition)!=0)
+ if(test_EXFAT((struct exfat_super_block*)buffer)!=0)
{
free(buffer);
return 1;
@@ -79,19 +79,18 @@ int check_EXFAT(disk_t *disk, partition_t *partition)
return 0;
}
-int test_EXFAT(const struct exfat_super_block *exfat_header, partition_t *partition)
+int test_EXFAT(const struct exfat_super_block *exfat_header)
{
if(le16(exfat_header->signature)!=0xAA55)
return 1;
if(memcmp(exfat_header->oem_id, "EXFAT ", sizeof(exfat_header->oem_id))!=0)
return 1;
- partition->upart_type=UP_EXFAT;
return 0;
}
int recover_EXFAT(const disk_t *disk, const struct exfat_super_block *exfat_header, partition_t *partition)
{
- if(test_EXFAT(exfat_header, partition)!=0)
+ if(test_EXFAT(exfat_header)!=0)
return 1;
partition->sborg_offset=0;
partition->sb_size=12 << exfat_header->blocksize_bits;