summaryrefslogtreecommitdiff
path: root/support.cc
diff options
context:
space:
mode:
authorWilliam Grant <wgrant@ubuntu.com>2015-06-19 19:55:27 +1000
committerWilliam Grant <wgrant@ubuntu.com>2015-06-19 20:03:29 +1000
commit5b2c6c89be2837a3988128467ec85bf567d9c552 (patch)
tree2bf2ba37878796ba81b73be8c8ae7f669e23d9c8 /support.cc
parent8017e083aac6377e95170d520184c1834e9021a4 (diff)
downloadsgdisk-5b2c6c89be2837a3988128467ec85bf567d9c552.tar.gz
Don't leave suffix uninitialised when none was passed to IeeeToInt.
Fixes incorrect partition boundaries and other failures on ppc64el and possibly other architectures.
Diffstat (limited to 'support.cc')
-rw-r--r--support.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/support.cc b/support.cc
index 0833a3e..7a6354d 100644
--- a/support.cc
+++ b/support.cc
@@ -144,7 +144,7 @@ uint64_t GetSectorNum(uint64_t low, uint64_t high, uint64_t def, uint64_t sSize,
uint64_t IeeeToInt(string inValue, uint64_t sSize, uint64_t low, uint64_t high, uint64_t def) {
uint64_t response = def, bytesPerUnit = 1, mult = 1, divide = 1;
size_t foundAt = 0;
- char suffix, plusFlag = ' ';
+ char suffix = ' ', plusFlag = ' ';
string suffixes = "KMGTPE";
int badInput = 0; // flag bad input; once this goes to 1, other values are irrelevant