Signed-off-by: Francesco Cosoleto <cosoleto@gmail.com>
static void
delete_partition(int i)
{
+ if (i < 0)
+ return;
+
if (warn_geometry())
return; /* C/H/S not set */
static void command_prompt(void)
{
- int c, j;
+ int c;
if (disklabel == OSF_LABEL) {
putchar('\n');
unknown_command(c);
break;
case 'd':
- j = get_existing_partition(1, partitions);
- if (j >= 0)
- delete_partition(j);
+ delete_partition(get_existing_partition(1, partitions));
break;
case 'i':
if (disklabel == SGI_LABEL)