summaryrefslogtreecommitdiff
path: root/support.cc
diff options
context:
space:
mode:
authorRoderick W. Smith <rodsmith@rodsbooks.com>2015-03-17 19:46:05 -0400
committerRoderick W. Smith <rodsmith@rodsbooks.com>2015-03-17 19:46:05 -0400
commit54f8fb17e64e09ca508d266356d9c6fd34a4fd4c (patch)
tree3dbbaccb5db64333c23a171c9c7c984c95986582 /support.cc
parent50d3f8fcb214125c1d31c2955960615e9eab3d81 (diff)
downloadsgdisk-54f8fb17e64e09ca508d266356d9c6fd34a4fd4c.tar.gz
Version 1.0.0 release! Added some type codes and the -O/--print-mbr
option for sgdisk.
Diffstat (limited to 'support.cc')
-rw-r--r--support.cc14
1 files changed, 13 insertions, 1 deletions
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;