From f5c9fef096a2db999aa837e786e3134e5f6302b9 Mon Sep 17 00:00:00 2001 From: Guillaume Gonnet Date: Wed, 15 May 2019 20:50:55 +0200 Subject: [PATCH] pkg/semtech_loramac: fix DEBUG message when payload is NULL In function `_semtech_loramac_send` parameter `payload` can be NULL (that the case when scheduling an immediate TX, line 726). As DEBUG macro use printf, a %s parameter can't be NULL so we have to handle that case. --- pkg/semtech-loramac/contrib/semtech_loramac.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/semtech-loramac/contrib/semtech_loramac.c b/pkg/semtech-loramac/contrib/semtech_loramac.c index eafb861a2d..5308733122 100644 --- a/pkg/semtech-loramac/contrib/semtech_loramac.c +++ b/pkg/semtech-loramac/contrib/semtech_loramac.c @@ -82,7 +82,7 @@ typedef struct { static uint8_t _semtech_loramac_send(semtech_loramac_t *mac, uint8_t *payload, uint8_t len) { - DEBUG("[semtech-loramac] send frame %s\n", (char *)payload); + DEBUG("[semtech-loramac] send frame %s\n", payload ? (char *)payload : "(empty)"); McpsReq_t mcpsReq; LoRaMacTxInfo_t txInfo; uint8_t dr = semtech_loramac_get_dr(mac);