summaryrefslogtreecommitdiffstats
path: root/src/partxbox.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/partxbox.c')
-rw-r--r--src/partxbox.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/partxbox.c b/src/partxbox.c
index 699264d..4cd1817 100644
--- a/src/partxbox.c
+++ b/src/partxbox.c
@@ -151,14 +151,12 @@ list_part_t *add_partition_xbox_cli(disk_t *disk_car,list_part_t *list_part, cha
assert(current_cmd!=NULL);
new_partition->part_offset=disk_car->sector_size;
new_partition->part_size=disk_car->disk_size-disk_car->sector_size;
- while(*current_cmd[0]==',')
- (*current_cmd)++;
while(1)
{
- if(strncmp(*current_cmd,"s,",2)==0)
+ skip_comma_in_command(current_cmd);
+ if(check_command(current_cmd,"s,",2)==0)
{
uint64_t part_offset;
- (*current_cmd)+=2;
part_offset=new_partition->part_offset;
new_partition->part_offset=(uint64_t)ask_number_cli(
current_cmd,
@@ -169,9 +167,8 @@ list_part_t *add_partition_xbox_cli(disk_t *disk_car,list_part_t *list_part, cha
(uint64_t)disk_car->sector_size;
new_partition->part_size=new_partition->part_size + part_offset - new_partition->part_offset;
}
- else if(strncmp(*current_cmd,"S,",2)==0)
+ else if(check_command(current_cmd,"S,",2)==0)
{
- (*current_cmd)+=2;
new_partition->part_size=(uint64_t)ask_number_cli(
current_cmd,
(new_partition->part_offset+new_partition->part_size-1)/disk_car->sector_size,
@@ -181,9 +178,8 @@ list_part_t *add_partition_xbox_cli(disk_t *disk_car,list_part_t *list_part, cha
(uint64_t)disk_car->sector_size +
disk_car->sector_size - new_partition->part_offset;
}
- else if(strncmp(*current_cmd,"T,",2)==0)
+ else if(check_command(current_cmd,"T,",2)==0)
{
- (*current_cmd)+=2;
change_part_type_cli(disk_car,new_partition,current_cmd);
}
else if(new_partition->part_size>0 && new_partition->part_type_xbox>0)