diff options
author | srs5694 <srs5694@users.sourceforge.net> | 2010-01-03 20:57:08 -0500 |
---|---|---|
committer | srs5694 <srs5694@users.sourceforge.net> | 2010-01-03 20:57:08 -0500 |
commit | 5d58fe0ea12c9c727c8a970c8e1ac08ea7fbe05f (patch) | |
tree | 56f8e7514b233fa9b7d0cba24115ffc616e81d66 /gptpart.cc | |
parent | 1d1448a82d62ad32a8d597ed9ade46b4f37d8eb5 (diff) | |
download | sgdisk-5d58fe0ea12c9c727c8a970c8e1ac08ea7fbe05f.tar.gz |
Version 0.5.3 changes. Minor bug fixes & detection of the number of
logical sectors per physical sector on Linux 2.6.32 and above.
Diffstat (limited to 'gptpart.cc')
-rw-r--r-- | gptpart.cc | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -187,6 +187,7 @@ void GPTPart::ShowDetails(uint32_t blockSize) { // Change the type code on the partition. void GPTPart::ChangeType(void) { char typeName[255], line[255]; + char* junk; int typeNum = 0xFFFF; // uint16_t typeNum = 0xFFFF; GUIDData newType; @@ -195,7 +196,7 @@ void GPTPart::ChangeType(void) { // printf("Current type is '%s'\n", typeHelper.GUIDToName(partitionType, typeName)); while ((!typeHelper.Valid(typeNum)) && (typeNum != 0)) { printf("Hex code (L to show codes, 0 to enter raw code): "); - fgets(line, 255, stdin); + junk = fgets(line, 255, stdin); sscanf(line, "%X", &typeNum); if ((line[0] == 'L') || (line[0] == 'l')) typeHelper.ShowTypes(); @@ -215,6 +216,7 @@ void GPTPart::ChangeType(void) { // string. This function creates a simple-minded copy for this. void GPTPart::SetName(unsigned char* theName) { char newName[NAME_SIZE]; // New name + char* junk; int i; // Blank out new name string, just to be on the safe side.... @@ -223,7 +225,7 @@ void GPTPart::SetName(unsigned char* theName) { if (theName == NULL) { // No name specified, so get one from the user printf("Enter name: "); - fgets(newName, NAME_SIZE / 2, stdin); + junk = fgets(newName, NAME_SIZE / 2, stdin); // Input is likely to include a newline, so remove it.... i = strlen(newName); |