summaryrefslogtreecommitdiff
path: root/gdisk.cc
diff options
context:
space:
mode:
authorsrs5694 <srs5694@users.sourceforge.net>2010-01-03 20:57:08 -0500
committersrs5694 <srs5694@users.sourceforge.net>2010-01-03 20:57:08 -0500
commit5d58fe0ea12c9c727c8a970c8e1ac08ea7fbe05f (patch)
tree56f8e7514b233fa9b7d0cba24115ffc616e81d66 /gdisk.cc
parent1d1448a82d62ad32a8d597ed9ade46b4f37d8eb5 (diff)
downloadsgdisk-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 'gdisk.cc')
-rw-r--r--gdisk.cc22
1 files changed, 13 insertions, 9 deletions
diff --git a/gdisk.cc b/gdisk.cc
index 3414d89..f11207e 100644
--- a/gdisk.cc
+++ b/gdisk.cc
@@ -29,7 +29,7 @@ int main(int argc, char* argv[]) {
int doMore = 1;
char* device = NULL;
- printf("GPT fdisk (gdisk) version 0.5.2\n\n");
+ printf("GPT fdisk (gdisk) version 0.5.3\n\n");
if (argc == 2) { // basic usage
if (SizesOK()) {
@@ -48,6 +48,7 @@ int main(int argc, char* argv[]) {
fprintf(stderr, "Usage: %s [-l] device_file\n", argv[0]);
} // if/elseif/else
if (device != NULL) {
+ theGPT.JustLooking();
doMore = theGPT.LoadPartitions(device);
if (doMore) theGPT.DisplayGPTData();
} // if
@@ -61,19 +62,20 @@ int main(int argc, char* argv[]) {
// wants to exit (such as after a 'w' or 'q' command).
void MainMenu(char* filename, struct GPTData* theGPT) {
char command, line[255], buFile[255];
+ char* junk;
int goOn = 1;
PartTypes typeHelper;
uint32_t temp1, temp2;
do {
printf("\nCommand (? for help): ");
- fgets(line, 255, stdin);
+ junk = fgets(line, 255, stdin);
sscanf(line, "%c", &command);
switch (command) {
case 'b': case 'B':
printf("Enter backup filename to save: ");
- fgets(line, 255, stdin);
- sscanf(line, "%s", &buFile);
+ junk = fgets(line, 255, stdin);
+ sscanf(line, "%s", (char*) &buFile);
theGPT->SaveGPTBackup(buFile);
break;
case 'c': case 'C':
@@ -163,13 +165,14 @@ void ShowCommands(void) {
// issues an exit command, such as 'w' or 'q'.
void RecoveryMenu(char* filename, struct GPTData* theGPT) {
char command, line[255], buFile[255];
+ char* junk;
PartTypes typeHelper;
uint32_t temp1;
int goOn = 1;
do {
printf("\nrecovery/transformation command (? for help): ");
- fgets(line, 255, stdin);
+ junk = fgets(line, 255, stdin);
sscanf(line, "%c", &command);
switch (command) {
case 'b': case 'B':
@@ -222,8 +225,8 @@ void RecoveryMenu(char* filename, struct GPTData* theGPT) {
break;
case 'l': case 'L':
printf("Enter backup filename to load: ");
- fgets(line, 255, stdin);
- sscanf(line, "%s", &buFile);
+ junk = fgets(line, 255, stdin);
+ sscanf(line, "%s", (char*) &buFile);
theGPT->LoadGPTBackup(buFile);
break;
case 'm': case 'M':
@@ -286,6 +289,7 @@ void ShowRecoveryCommands(void) {
// selects an exit command, such as 'w' or 'q'.
void ExpertsMenu(char* filename, struct GPTData* theGPT) {
char command, line[255];
+ char* junk;
PartTypes typeHelper;
uint32_t pn;
uint32_t temp1, temp2;
@@ -293,7 +297,7 @@ void ExpertsMenu(char* filename, struct GPTData* theGPT) {
do {
printf("\nExpert command (? for help): ");
- fgets(line, 255, stdin);
+ junk = fgets(line, 255, stdin);
sscanf(line, "%c", &command);
switch (command) {
case 'a': case 'A':
@@ -310,7 +314,7 @@ void ExpertsMenu(char* filename, struct GPTData* theGPT) {
} else printf("No partitions\n");
break;
case 'd': case 'D':
- printf("The number of logical sectors per physical sector is set to %d.\n",
+ printf("The number of logical sectors per physical sector is %d.\n",
theGPT->GetAlignment());
break;
case 'e': case 'E':