From 32926c30deac89d076b3d62dfcec74bcf067738b Mon Sep 17 00:00:00 2001 From: Morgan Allen Date: Sun, 29 Jul 2018 00:49:23 -0700 Subject: [PATCH] use strlen instead of sizeof to determine command length --- test/lora32/main/main.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/test/lora32/main/main.c b/test/lora32/main/main.c index 824a5c7..31893df 100644 --- a/test/lora32/main/main.c +++ b/test/lora32/main/main.c @@ -68,8 +68,10 @@ static void uart_event_task(void *pvParameters) { struct Cmd *handler; uint8_t match = ucmdr_match((char *)dtmp, &handler); + ESP_LOGD(TAG, "command size: %d", strlen(handler->cmd)); + if(match) { - handler->callback(dtmp + sizeof(handler->cmd)); + handler->callback(dtmp + strlen(handler->cmd)); } else { printf("command not found\n"); }