use strlen instead of sizeof to determine command length

This commit is contained in:
Morgan Allen 2018-07-29 00:49:23 -07:00
parent db74ecbfb9
commit 32926c30de

View file

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