diff --git a/nimble/host/src/ble_hs_log.c b/nimble/host/src/ble_hs_log.c index 5aafd61ec..7ccc49331 100644 --- a/nimble/host/src/ble_hs_log.c +++ b/nimble/host/src/ble_hs_log.c @@ -26,17 +26,16 @@ struct log ble_hs_log; void ble_hs_log_mbuf(const struct os_mbuf *om) { - const struct os_mbuf *cur; + uint8_t u8; int i; if (om == NULL) { return; } - for (cur = om; cur != NULL; cur = SLIST_NEXT(cur, om_next)) { - for (i = 0; i < cur->om_len; i++) { - BLE_HS_LOG(DEBUG, "0x%02x ", cur->om_data[i]); - } + for (i = 0; i < OS_MBUF_PKTLEN(om); i++) { + os_mbuf_copydata(om, i, 1, &u8); + BLE_HS_LOG(DEBUG, "0x%02x ", u8); } }