[Positioner] AccessPoint: avoid division by zero

This commit is contained in:
Matteo Cypriani 2012-05-29 13:43:04 +02:00
parent b8722b6a6c
commit d3733c2083
1 changed files with 3 additions and 0 deletions

View File

@ -71,6 +71,9 @@ received_calibration_from_ap(const AccessPoint &trx) const
expected_packets += (*cr)->get_nb_packets() ;
}
if (expected_packets == 0)
return 0 ;
// Compute the score (percent):
float score = received_packets * 100.0 / expected_packets ;
return score ;