From 61480857943008720bc6a0f7fbb4d5414b25dda8 Mon Sep 17 00:00:00 2001
From: "Leigh B. Stoller" <stoller@flux.utah.edu>
Date: Fri, 21 Jun 2002 22:45:24 +0000
Subject: [PATCH] Fix error in DOS partition selection; 0 is not valid in the
 EZ page since we are saving just a single slice, and 0 is actually the MBR
 (by local convention).

---
 www/newimageid_ez.php3 | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/www/newimageid_ez.php3 b/www/newimageid_ez.php3
index f96c83ade1..43273a215d 100644
--- a/www/newimageid_ez.php3
+++ b/www/newimageid_ez.php3
@@ -169,7 +169,7 @@ function SPITFORM($formfields, $errors)
               <td><select name=\"formfields[loadpart]\">
                           <option value=X>Please Select </option>\n";
 
-    for ($i = 0; $i <= 4; $i++) {
+    for ($i = 1; $i <= 4; $i++) {
 	$selected = "";
 
 	if (strcmp($formfields[loadpart], "$i") == 0)
@@ -416,7 +416,7 @@ if (!isset($formfields[loadpart]) ||
     $errors["DOS Partition"] = "Not Selected";
 }
 elseif (! ereg("^[0-9]+$", $formfields[loadpart]) ||
-	$formfields[loadpart] < 0 || $formfields[loadpart] > 4) {
+	$formfields[loadpart] <= 0 || $formfields[loadpart] > 4) {
     $errors["DOS Partition"] = "Must be 1,2,3, or 4!";
 }
 
-- 
GitLab