summaryrefslogtreecommitdiff
path: root/sgdisk.cc
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2010-09-22 10:50:24 -0400
committersrs5694 <srs5694@users.sourceforge.net>2010-09-22 10:50:24 -0400
commit82f3f0b529ec1bb936141ae41b03f95c72ce573a (patch)
treeb6233ff63f89d536a0cdf38b95e3a7cfb974b6b5 /sgdisk.cc
parent327129e9331f888a8fc08d688dcb0a739a3c17be (diff)
downloadsgdisk-82f3f0b529ec1bb936141ae41b03f95c72ce573a.tar.gz
Further refinements to GUID type code entry.
Diffstat (limited to 'sgdisk.cc')
-rw-r--r--sgdisk.cc12
1 files changed, 3 insertions, 9 deletions
diff --git a/sgdisk.cc b/sgdisk.cc
index 612c526..b829d3c 100644
--- a/sgdisk.cc
+++ b/sgdisk.cc
@@ -35,7 +35,6 @@ int main(int argc, char *argv[]) {
int saveNonGPT = 1;
uint32_t gptPartNum = 0;
int alignment = DEFAULT_ALIGNMENT, retval = 0, pretend = 0;
- unsigned int hexCode;
uint32_t tableSize = 128;
uint64_t startSector, endSector;
char *attributeOperation = NULL;
@@ -305,14 +304,9 @@ int main(int argc, char *argv[]) {
case 't':
theGPT.JustLooking(0);
partNum = (int) GetInt(typeCode, 1) - 1;
- cout << "Got string '" << GetString(typeCode, 2) << "'\n";
- if (GetString(typeCode, 2).length() < 10) {
- sscanf(GetString(typeCode, 2).c_str(), "%x", &hexCode);
- typeHelper = hexCode;
- } else {
- typeHelper = GetString(typeCode, 2);
- } // if/else hexCode or GUID
- if (theGPT.ChangePartType(partNum, typeHelper)) {
+ typeHelper = GetString(typeCode, 2);
+ if ((typeHelper != (GUIDData) "00000000-0000-0000-0000-000000000000") &&
+ (theGPT.ChangePartType(partNum, typeHelper))) {
saveData = 1;
} else {
cerr << "Could not change partition " << partNum + 1