Skip to content

Commit

Permalink
monitor: Fix runtime error
Browse files Browse the repository at this point in the history
This fixes the following runtime error:

monitor/packet.c:10476:2: runtime error: division by zero
Floating point exception
  • Loading branch information
Vudentz committed Aug 31, 2023
1 parent 530afa4 commit c7fd931
Showing 1 changed file with 8 additions and 5 deletions.
13 changes: 8 additions & 5 deletions monitor/packet.c
Original file line number Diff line number Diff line change
Expand Up @@ -10473,11 +10473,14 @@ static void packet_dequeue_tx(struct timeval *tv, uint16_t handle)

packet_latency_add(&conn->tx_l, &delta);

print_field("#%zu: len %zu (%lld Kb/s)", frame->num, frame->len,
frame->len * 8 / TV_MSEC(delta));
print_field("Latency: %lld msec (%lld-%lld msec ~%lld msec)",
TV_MSEC(delta), TV_MSEC(conn->tx_l.min),
TV_MSEC(conn->tx_l.max), TV_MSEC(conn->tx_l.med));
if (TV_MSEC(delta)) {
print_field("#%zu: len %zu (%lld Kb/s)", frame->num, frame->len,
frame->len * 8 / TV_MSEC(delta));
print_field("Latency: %lld msec (%lld-%lld msec ~%lld msec)",
TV_MSEC(delta), TV_MSEC(conn->tx_l.min),
TV_MSEC(conn->tx_l.max),
TV_MSEC(conn->tx_l.med));
}

l2cap_dequeue_frame(&delta, conn);

Expand Down

0 comments on commit c7fd931

Please sign in to comment.