AP_Logger: fix MAVLink logger random failure on SITL
rand() return an int
This commit is contained in:
parent
8216905f47
commit
99456ba1f8
@ -560,7 +560,7 @@ bool AP_Logger_MAVLink::send_log_block(struct dm_block &block)
|
|||||||
|
|
||||||
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
#if CONFIG_HAL_BOARD == HAL_BOARD_SITL
|
||||||
// deliberately fail 10% of the time in SITL:
|
// deliberately fail 10% of the time in SITL:
|
||||||
if (rand() < 0.1) {
|
if ((rand() % 100 + 1) < 10) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
Loading…
Reference in New Issue
Block a user