From 54f8fb17e64e09ca508d266356d9c6fd34a4fd4c Mon Sep 17 00:00:00 2001 From: "Roderick W. Smith" Date: Tue, 17 Mar 2015 19:46:05 -0400 Subject: Version 1.0.0 release! Added some type codes and the -O/--print-mbr option for sgdisk. --- support.cc | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) (limited to 'support.cc') diff --git a/support.cc b/support.cc index 8c56c91..0833a3e 100644 --- a/support.cc +++ b/support.cc @@ -34,6 +34,17 @@ using namespace std; // Reads a string from stdin, returning it as a C++-style string. // Note that the returned string will NOT include the carriage return // entered by the user. +#ifdef EFI +extern int __sscanf( const char * str , const char * format , ... ) ; +string ReadString(void) { + string inString; + char efiString[256]; + + fgets(efiString, 255, stdin); + inString = efiString; + return inString; +} // ReadString() +#else string ReadString(void) { string inString; @@ -42,6 +53,7 @@ string ReadString(void) { exit(5); return inString; } // ReadString() +#endif // Get a numeric value from the user, between low and high (inclusive). // Keeps looping until the user enters a value within that range. @@ -225,7 +237,7 @@ string BytesToIeee(uint64_t size, uint32_t sectorSize) { uint64_t sizeInIeee; uint64_t previousIeee; float decimalIeee; - uint index = 0; + uint64_t index = 0; string units, prefixes = " KMGTPEZ"; ostringstream theValue; -- cgit v1.2.1