Snap for 4683893 from 9c50b5e176b95034b54d04856388ac3be6132076 to pi-release

Change-Id: I37daa5f4452442119a1582626c183326281ed0ea
diff --git a/gptcl.cc b/gptcl.cc
index f80db25..6e1f89f 100644
--- a/gptcl.cc
+++ b/gptcl.cc
@@ -365,7 +365,10 @@
                      partNum = newPartNum;
                   if ((partNum >= 0) && (partNum < (int) GetNumParts())) {
                      // Remember the original hex value requested
-                     typeRaw[partNum] = GetString(typeCode, 2);
+                     string raw = GetString(typeCode, 2);
+                     if (raw.size() == 4) {
+                        typeRaw[partNum] = StrToHex(raw, 0);
+                     }
                      typeHelper = GetString(typeCode, 2);
                      if ((typeHelper != (GUIDData) "00000000-0000-0000-0000-000000000000") &&
                          (ChangePartType(partNum, typeHelper))) {
@@ -499,10 +502,7 @@
                // If we were created with a specific hex type, use that instead
                // of risking fidelity loss by doing a GUID-based lookup
                if (typeRaw.count(origPartNum) == 1) {
-                  string raw = typeRaw[origPartNum];
-                  if (raw.size() == 4) {
-                     newPart.SetType(StrToHex(raw, 0));
-                  }
+                  newPart.SetType(typeRaw[origPartNum]);
                }
                newMBR.AddPart(i + isHybrid, newPart);
             } else {
diff --git a/gptcl.h b/gptcl.h
index 7484a49..d8fa9ff 100644
--- a/gptcl.h
+++ b/gptcl.h
@@ -37,7 +37,7 @@
       int alignment, deletePartNum, infoPartNum, largestPartNum, bsdPartNum;
       uint32_t tableSize;
       poptContext poptCon;
-      std::map<int, string> typeRaw;
+      std::map<int, char> typeRaw;
 
       int BuildMBR(char* argument, int isHybrid);
    public: