diff --git a/src/drive.cpp b/src/drive.cpp index 78b99ed..5ae0b7e 100644 --- a/src/drive.cpp +++ b/src/drive.cpp @@ -62,6 +62,10 @@ string Drive::sCapacityToText() dSize /= 1000; u16UnitIndex++; } + if (u16UnitIndex >= 9) + { + u16UnitIndex = 8; + } int precision = (u16UnitIndex >= 3) ? (u16UnitIndex - 3) : 0; sprintf(acBuffer, "%.*f %s", precision, dSize, units[u16UnitIndex]); return acBuffer;