try to restrain long string dumps

This commit is contained in:
Morgan 'ARR\!' Allen 2020-04-24 22:58:59 -07:00
parent 417f7856eb
commit 3d65f73f97

View file

@ -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);