summaryrefslogtreecommitdiff
path: root/basicmbr.cc
diff options
context:
space:
mode:
authorRoderick W. Smith <rodsmith@rodsbooks.com>2014-02-17 16:17:11 -0500
committerRoderick W. Smith <rodsmith@rodsbooks.com>2014-02-17 16:17:11 -0500
commit84aaff6b9cf3b802c621781cf9acd006aa5a3e66 (patch)
tree9f46bf77212466e4e66a2163ab86a8be39b62508 /basicmbr.cc
parent22e88b5be2c0c3f92e34d95da45922abfa02a28d (diff)
downloadsgdisk-84aaff6b9cf3b802c621781cf9acd006aa5a3e66.tar.gz
Removed libicu dependency for UTF-16 partition names. Version 0.8.9
release.
Diffstat (limited to 'basicmbr.cc')
-rw-r--r--basicmbr.cc4
1 files changed, 2 insertions, 2 deletions
diff --git a/basicmbr.cc b/basicmbr.cc
index 9e754d4..f7e1f6d 100644
--- a/basicmbr.cc
+++ b/basicmbr.cc
@@ -671,7 +671,7 @@ int BasicMBRData::LBAtoCHS(uint64_t lba, uint8_t * chs) {
done = 1;
} // if
// If LBA value is too large for CHS, max out CHS values....
- if ((!done) && (lba >= (numHeads * numSecspTrack * MAX_CYLINDERS))) {
+ if ((!done) && (lba >= ((uint64_t) numHeads * numSecspTrack * MAX_CYLINDERS))) {
chs[0] = 254;
chs[1] = chs[2] = 255;
done = 1;
@@ -1223,7 +1223,7 @@ void BasicMBRData::MaximizePrimaries() {
// Remove primary partitions in excess of 4, starting with the later ones,
// in terms of the array location....
void BasicMBRData::TrimPrimaries(void) {
- int numToDelete, i = MAX_MBR_PARTS;
+ int numToDelete, i = MAX_MBR_PARTS - 1;
numToDelete = NumPrimaries() - 4;
while ((numToDelete > 0) && (i >= 0)) {