From 0873e9d0e9345a2c4418b4718db525c9f1111c83 Mon Sep 17 00:00:00 2001 From: srs5694 Date: Thu, 7 Oct 2010 13:00:45 -0400 Subject: Version 0.6.12 release; mostly changes in support for disks with other than 512-byte sectors. --- parttypes.cc | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'parttypes.cc') diff --git a/parttypes.cc b/parttypes.cc index 37f47a7..d8d8624 100644 --- a/parttypes.cc +++ b/parttypes.cc @@ -192,13 +192,16 @@ int PartType::AddType(uint16_t mbrType, const char * guidData, const char * name // Assignment operator by string. If the original string is short, // interpret it as a gdisk hex code; if it's longer, interpret it as -// a direct entry of a GUID value.... +// a direct entry of a GUID value. If a short string isn't a hex +// number, do nothing. PartType & PartType::operator=(const string & orig) { uint32_t hexCode; if (orig.length() < 32) { - sscanf(orig.c_str(), "%x", &hexCode); - *this = hexCode; + if (IsHex(orig)) { + sscanf(orig.c_str(), "%x", &hexCode); + *this = hexCode; + } // if } else { GUIDData::operator=(orig); } // if/else hexCode or GUID -- cgit v1.2.3