From: Ben Gras Date: Mon, 22 Aug 2005 09:54:31 +0000 (+0000) Subject: Added two sanity checks: X-Git-Tag: v3.1.0~322 X-Git-Url: http://zhaoyanbai.com/repos/Bv9ARM.ch07.html?a=commitdiff_plain;h=0ab4039806f5e8e16a4723dd16c349f2d12cb818;p=minix.git Added two sanity checks: . partitions larger than the disk (this happens when partitions are set to end earlier than they start in part) . zero-sized partitions (this confuses autopart later on) autopart doesn't continue if this happens. --- diff --git a/commands/ibm/autopart.c b/commands/ibm/autopart.c index 96dcda1a9..ad5500736 100755 --- a/commands/ibm/autopart.c +++ b/commands/ibm/autopart.c @@ -1794,6 +1794,16 @@ void regionize(void) exit(1); } } + if(table[i].size > table[0].size) { + printf("\nSanity check failed on %s - partition is larger than disk.\n" + "Please use expert mode to correct it.\n", curdev->name); + exit(1); + } + if(table[i].size < 1) { + printf("\nSanity check failed on %s - zero-sized partition.\n" + "Please use expert mode to correct it.\n", curdev->name); + exit(1); + } /* Remember used region. */ memcpy(®ions[nr_regions].used_part, &table[i], sizeof(table[i]));