summaryrefslogtreecommitdiffstats
path: root/src/parthumax.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/parthumax.c')
-rw-r--r--src/parthumax.c12
1 files changed, 4 insertions, 8 deletions
diff --git a/src/parthumax.c b/src/parthumax.c
index c9af332..86b3cd4 100644
--- a/src/parthumax.c
+++ b/src/parthumax.c
@@ -194,23 +194,19 @@ list_part_t *add_partition_humax_cli(disk_t *disk_car,list_part_t *list_part, ch
end.cylinder=disk_car->geom.cylinders-1;
end.head=disk_car->geom.heads_per_cylinder-1;
end.sector=disk_car->geom.sectors_per_head;
- while(*current_cmd[0]==',')
- (*current_cmd)++;
while(1)
{
- if(strncmp(*current_cmd,"c,",2)==0)
+ skip_comma_in_command(current_cmd);
+ if(check_command(current_cmd,"c,",2)==0)
{
- (*current_cmd)+=2;
start.cylinder=ask_number_cli(current_cmd, start.cylinder,0,disk_car->geom.cylinders-1,"Enter the starting cylinder ");
}
- else if(strncmp(*current_cmd,"C,",2)==0)
+ else if(check_command(current_cmd,"C,",2)==0)
{
- (*current_cmd)+=2;
end.cylinder=ask_number_cli(current_cmd, end.cylinder,start.cylinder,disk_car->geom.cylinders-1,"Enter the ending cylinder ");
}
- 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((CHS2offset(disk_car,&end)>new_partition->part_offset) &&