Skip to content

Commit 888a0fb

Browse files
author
Jarkko Paso
committed
fhss_ws: check if 0 used as divider
1 parent 586f2f2 commit 888a0fb

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

source/Service_Libs/fhss/fhss_ws.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -88,6 +88,9 @@ static uint32_t fhss_set_txrx_slot_length(fhss_structure_t *fhss_structure);
8888
// This function supports rounding up
8989
static int64_t divide_integer(int64_t dividend, int32_t divisor)
9090
{
91+
if (!divisor) {
92+
return dividend;
93+
}
9194
if (dividend < 0) {
9295
return (dividend - divisor / 2) / divisor;
9396
}

0 commit comments

Comments
 (0)