summaryrefslogtreecommitdiff
path: root/sgdisk.cc
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2010-01-29 17:44:04 -0500
committersrs5694 <srs5694@users.sourceforge.net>2010-01-29 17:44:04 -0500
commite321d444dcca514cf6b53459e388ddcbaab6176c (patch)
tree7c2c07142193cf2a66a958f59fb35d0ee0ca9ca0 /sgdisk.cc
parent0a6973119c9e9984ad47a6da3231e8d16f996c5c (diff)
downloadsgdisk-e321d444dcca514cf6b53459e388ddcbaab6176c.tar.gz
Final 0.6.2 release; misc. bug fixes & Windows version
Diffstat (limited to 'sgdisk.cc')
-rw-r--r--sgdisk.cc16
1 files changed, 8 insertions, 8 deletions
diff --git a/sgdisk.cc b/sgdisk.cc
index 14f95e5..bdb2eb2 100644
--- a/sgdisk.cc
+++ b/sgdisk.cc
@@ -28,14 +28,14 @@ string GetString(char* Info, int itemNum);
int main(int argc, char *argv[]) {
GPTData theGPT;
- int opt, i, numOptions = 0, saveData = 0, neverSaveData = 0;
+ int opt, numOptions = 0, saveData = 0, neverSaveData = 0;
int partNum = 0, deletePartNum = 0, infoPartNum = 0, bsdPartNum = 0, saveNonGPT = 1;
int alignment = 8, retval = 0, pretend = 0;
- uint16_t hexCode;
+ unsigned int hexCode;
uint32_t tableSize = 128;
uint64_t startSector, endSector;
- char* device = NULL;
- char *argument = NULL, *newPartInfo = NULL, *typeCode = NULL, *partName;
+ char *device = NULL;
+ char *newPartInfo = NULL, *typeCode = NULL, *partName;
char *backupFile = NULL;
PartTypes typeHelper;
@@ -205,7 +205,7 @@ int main(int argc, char *argv[]) {
case 't':
theGPT.JustLooking(0);
partNum = (int) GetInt(typeCode, 1) - 1;
- sscanf(GetString(typeCode, 2).c_str(), "%x", &hexCode);
+ sscanf(GetString(typeCode, 2).c_str(), "%ux", &hexCode);
if (theGPT.ChangePartType(partNum, hexCode)) {
saveData = 1;
} else {
@@ -255,7 +255,7 @@ int main(int argc, char *argv[]) {
// Extract integer data from argument string, which should be colon-delimited
uint64_t GetInt(char* argument, int itemNum) {
int startPos = -1, endPos = -1;
- uint64_t retval = 0;
+ unsigned long long retval = 0;
string Info;
Info = argument;
@@ -263,7 +263,7 @@ uint64_t GetInt(char* argument, int itemNum) {
startPos = endPos + 1;
endPos = Info.find(':', startPos);
}
- if (endPos == string::npos)
+ if (endPos == (int) string::npos)
endPos = Info.length();
endPos--;
@@ -281,7 +281,7 @@ string GetString(char* argument, int itemNum) {
startPos = endPos + 1;
endPos = Info.find(':', startPos);
}
- if (endPos == string::npos)
+ if (endPos == (int) string::npos)
endPos = Info.length();
endPos--;