New checks for an oversized 0xEE protective (or any hybrid MBR)
partition. Auto-corrects on loading if protective & otherwise valid;
if not, verify and save operations warn of the problem.
diff --git a/gpt.cc b/gpt.cc
index 23e1bb2..fa7b661 100644
--- a/gpt.cc
+++ b/gpt.cc
@@ -291,6 +291,12 @@
    // Verify that partitions don't run into GPT data areas....
    problems += CheckGPTSize();
 
+   if (!protectiveMBR.DoTheyFit()) {
+      cout << "\nPartition(s) in the protective MBR are too big for the disk! Creating a\n"
+           << "fresh protective or hybrid MBR is recommended.\n";
+      problems++;
+   }
+
    // Check that partitions are aligned on proper boundaries (for WD Advanced
    // Format and similar disks)....
    for (i = 0; i < numParts; i++) {
@@ -681,6 +687,15 @@
    // Load the GPT data, whether or not it's valid
    ForceLoadGPTData();
 
+   // Some tools create a 0xEE partition that's too big. If this is detected,
+   // normalize it....
+   if ((state == gpt_valid) && !protectiveMBR.DoTheyFit() && (protectiveMBR.GetValidity() == gpt)) {
+      if (!beQuiet) {
+         cerr << "\aThe protective MBR's 0xEE partition is oversized! Auto-repairing.\n\n";
+      } // if
+      protectiveMBR.MakeProtectiveMBR();
+   } // if
+
    if (!beQuiet) {
       cout << "Partition table scan:\n";
       protectiveMBR.ShowState();
@@ -1056,6 +1071,12 @@
       cerr << "Aborting write operation!\n";
    } // if
 
+   // Check that protective MBR fits, and warn if it doesn't....
+   if (!protectiveMBR.DoTheyFit()) {
+      cerr << "\nPartition(s) in the protective MBR are too big for the disk! Creating a\n"
+           << "fresh protective or hybrid MBR is recommended.\n";
+   }
+
    // Check for mismatched MBR and GPT data, but let it pass if found
    // (function displays warning message)
    FindHybridMismatches();