mirror of
https://git.rtems.org/rtems-tools/
synced 2025-06-12 10:33:46 +08:00
ReportsBase.cc: Remove possible division by zero
CID 1503709: Division or modulo by float zero Closes #4415
This commit is contained in:
parent
b1ad7e2f6e
commit
ffbf313928
@ -482,9 +482,11 @@ void ReportsBase::WriteSummaryReport(
|
||||
}
|
||||
}
|
||||
|
||||
percentage = (double) notExecuted;
|
||||
percentage /= (double) totalBytes;
|
||||
percentage *= 100.0;
|
||||
if ( totalBytes == 0 ) {
|
||||
percentage = 0;
|
||||
} else {
|
||||
percentage = 100.0 * (double) notExecuted / totalBytes;
|
||||
}
|
||||
|
||||
percentageBranches = (double) (
|
||||
SymbolsToAnalyze->getNumberBranchesAlwaysTaken(symbolSetName) +
|
||||
|
Loading…
x
Reference in New Issue
Block a user