bugfix/ai-static-analysis #82

Open
localhorst wants to merge 15 commits from bugfix/ai-static-analysis into master
5 changed files with 138 additions and 115 deletions
Showing only changes of commit c7d37b1d95 - Show all commits

View File

@ -62,6 +62,10 @@ string Drive::sCapacityToText()
dSize /= 1000; dSize /= 1000;
u16UnitIndex++; u16UnitIndex++;
} }
if (u16UnitIndex >= 9)
{
u16UnitIndex = 8;
}
int precision = (u16UnitIndex >= 3) ? (u16UnitIndex - 3) : 0; int precision = (u16UnitIndex >= 3) ? (u16UnitIndex - 3) : 0;
sprintf(acBuffer, "%.*f %s", precision, dSize, units[u16UnitIndex]); sprintf(acBuffer, "%.*f %s", precision, dSize, units[u16UnitIndex]);
return acBuffer; return acBuffer;