for (i = 1; i < npartitions; i++) spp[i]->p_offset = spp[i - 1]->p_offset + spp[i - 1]->p_size;
for (i = 1; i < npartitions; i++) { if (spp[i]->p_offset >= starting_sector || spp[i]->p_offset < ending_sector) spp[i]->p_offset = spp[i - 1]->p_offset + spp[i - 1]->p_size; }
make_contiguous(lp)	struct disklabel *lp;{	struct partition **spp;	u_int16_t npartitions;	int i;	/* Get a sorted list of the partitions */	spp = sort_partitions(lp, &npartitions);	/*	 * Make everything contiguous but don't muck with start of the first one	 */	for (i = 1; i < npartitions; i++)		spp[i]->p_offset = spp[i - 1]->p_offset + spp[i - 1]->p_size;	(void)free(spp);}