summaryrefslogtreecommitdiffstats
path: root/src/texfat.c
diff options
context:
space:
mode:
authorChristophe Grenier <grenier@cgsecurity.org>2018-03-17 17:29:28 +0100
committerChristophe Grenier <grenier@cgsecurity.org>2018-03-17 17:29:28 +0100
commit09ecae700f224a23cfd8f63f98cebeccbe768cc0 (patch)
tree83fbfb551cc9330a02dfb6762e2c4b8e6015eecb /src/texfat.c
parent331f0ef77e62140d0ee9252c33b23b383aa73084 (diff)
Use new functions check_command(), skip_comma_in_command() and get_int_from_command() to parse command line arguments
Diffstat (limited to 'src/texfat.c')
-rw-r--r--src/texfat.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/texfat.c b/src/texfat.c
index 65b860b..f626117 100644
--- a/src/texfat.c
+++ b/src/texfat.c
@@ -75,22 +75,18 @@ static void exFAT_dump(disk_t *disk, const partition_t *partition, const unsigne
static int exFAT_boot_sector_command(char **current_cmd, const char *options)
{
- while(*current_cmd[0]==',')
- (*current_cmd)++;
- if(strncmp(*current_cmd,"dump",4)==0)
+ skip_comma_in_command(current_cmd);
+ if(check_command(current_cmd,"dump",4)==0)
{
- (*current_cmd)+=4;
return 'D';
}
- else if(strncmp(*current_cmd,"originalexFAT",13)==0)
+ else if(check_command(current_cmd,"originalexFAT",13)==0)
{
- (*current_cmd)+=13;
if(strchr(options,'O')!=NULL)
return 'O';
}
- else if(strncmp(*current_cmd,"backupexFAT",11)==0)
+ else if(check_command(current_cmd,"backupexFAT",11)==0)
{
- (*current_cmd)+=11;
if(strchr(options,'B')!=NULL)
return 'B';
}