diff options
author | srs5694 <srs5694@users.sourceforge.net> | 2011-03-15 00:34:10 -0400 |
---|---|---|
committer | srs5694 <srs5694@users.sourceforge.net> | 2011-03-15 00:34:10 -0400 |
commit | 9a46b042c57144c26a67781d335e6ba4128382d2 (patch) | |
tree | a7126d54e9cd8387251787c7f1da6cfb7b44b8f2 /gdisk.cc | |
parent | d3ba7a61f68ca97fc3828f0c2edd7cda7ca3dfda (diff) | |
download | sgdisk-9a46b042c57144c26a67781d335e6ba4128382d2.tar.gz |
Patches supplied by Florian Zumbiehl
Diffstat (limited to 'gdisk.cc')
-rw-r--r-- | gdisk.cc | 16 |
1 files changed, 8 insertions, 8 deletions
@@ -84,13 +84,13 @@ void MainMenu(string filename, GPTDataTextUI* theGPT) { do { cout << "\nCommand (? for help): "; - ReadCString(line, 255); + ReadCString(line, sizeof(line)); switch (*line) { case '\n': break; case 'b': case 'B': cout << "Enter backup filename to save: "; - ReadCString(line, 255); + ReadCString(line, sizeof(line)); sscanf(line, "%s", buFile); theGPT->SaveGPTBackup(buFile); break; @@ -183,7 +183,7 @@ void RecoveryMenu(string filename, GPTDataTextUI* theGPT) { do { cout << "\nRecovery/transformation command (? for help): "; - ReadCString(line, 255); + ReadCString(line, sizeof(line)); switch (*line) { case '\n': break; @@ -239,7 +239,7 @@ void RecoveryMenu(string filename, GPTDataTextUI* theGPT) { break; case 'l': case 'L': cout << "Enter backup filename to load: "; - ReadCString(line, 255); + ReadCString(line, sizeof(line)); sscanf(line, "%s", buFile); theGPT->LoadGPTBackup(buFile); break; @@ -313,7 +313,7 @@ void ExpertsMenu(string filename, GPTDataTextUI* theGPT) { do { cout << "\nExpert command (? for help): "; - ReadCString(line, 255); + ReadCString(line, sizeof(line)); switch (*line) { case '\n': break; @@ -327,7 +327,7 @@ void ExpertsMenu(string filename, GPTDataTextUI* theGPT) { if (theGPT->GetPartRange(&temp1, &temp2) > 0) { pn = theGPT->GetPartNum(); cout << "Enter the partition's new unique GUID ('R' to randomize): "; - ReadCString(guidStr, 255); + ReadCString(guidStr, sizeof(guidStr)); if ((strlen(guidStr) >= 33) || (guidStr[0] == 'R') || (guidStr[0] == 'r')) { theGPT->SetPartitionGUID(pn, (GUIDData) guidStr); cout << "New GUID is " << theGPT->operator[](pn).GetUniqueGUID() << "\n"; @@ -349,7 +349,7 @@ void ExpertsMenu(string filename, GPTDataTextUI* theGPT) { break; case 'g': case 'G': cout << "Enter the disk's unique GUID ('R' to randomize): "; - ReadCString(guidStr, 255); + ReadCString(guidStr, sizeof(guidStr)); if ((strlen(guidStr) >= 33) || (guidStr[0] == 'R') || (guidStr[0] == 'r')) { theGPT->SetDiskGUID((GUIDData) guidStr); cout << "The new disk GUID is " << theGPT->GetDiskGUID() << "\n"; @@ -402,7 +402,7 @@ void ExpertsMenu(string filename, GPTDataTextUI* theGPT) { i = strlen(device); if (i && device[i - 1] == '\n') device[i - 1] = '\0'; - if (*device && strlen(device) > 0) { + if (*device) { secondDevice = *theGPT; secondDevice.SetDisk(device); secondDevice.SaveGPTData(0); |