try to restrain long string dumps
This commit is contained in:
parent
417f7856eb
commit
3d65f73f97
1 changed files with 5 additions and 0 deletions
|
@ -65,6 +65,11 @@ void lorcomm_handle_receive(uint8_t size) {
|
||||||
|
|
||||||
memcpy(msg->msg, buf + LORA_PACKET_HEADER_SIZE + LORA_MSG_HEADER_SIZE, msg->length);
|
memcpy(msg->msg, buf + LORA_PACKET_HEADER_SIZE + LORA_MSG_HEADER_SIZE, msg->length);
|
||||||
|
|
||||||
|
// if the msg doesnt end in NULL it's probably already corrupt
|
||||||
|
// just go ahead and terminate it
|
||||||
|
if(msg->msg[msg->length] != '\0')
|
||||||
|
msg->msg[msg->length] == '\0';
|
||||||
|
|
||||||
ESP_LOGI(TAG, "msg (len: %d): %s", msg->length, msg->msg);
|
ESP_LOGI(TAG, "msg (len: %d): %s", msg->length, msg->msg);
|
||||||
|
|
||||||
free(msg->msg);
|
free(msg->msg);
|
||||||
|
|
Loading…
Reference in a new issue