summaryrefslogtreecommitdiffstats
path: root/src/thfs.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/thfs.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/thfs.c')
-rw-r--r--src/thfs.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/thfs.c b/src/thfs.c
index 090288f..c3bada2 100644
--- a/src/thfs.c
+++ b/src/thfs.c
@@ -76,22 +76,18 @@ static void hfs_dump(disk_t *disk_car, const partition_t *partition, const unsig
static int HFS_HFSP_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,"originalhfsp",11)==0)
+ else if(check_command(current_cmd,"originalhfsp",11)==0)
{
- (*current_cmd)+=11;
if(strchr(options,'O')!=NULL)
return 'O';
}
- else if(strncmp(*current_cmd,"backuphfsp",9)==0)
+ else if(check_command(current_cmd,"backuphfsp",9)==0)
{
- (*current_cmd)+=9;
if(strchr(options,'B')!=NULL)
return 'B';
}