fix second message of unknown command
This commit is contained in:
2023-12-05 20:08:51 +01:00
parent 76f3044d21
commit 5c5fda62e6

View File

@@ -386,7 +386,9 @@ err_t tcp_cmd_recv(void* arg, struct tcp_pcb* pcb, struct pbuf* p, err_t err) {
// Split string into tokens by delimiter (space)
cmd_ptr = tcp_cmd_remove_leading_space(cmd, strlen(cmd));
argv[0] = tcp_cmd_get_next_token(cmd_ptr, " ", &next);
argc = 1;
if(argv[0] != NULL) {
argc = 1;
}
while (argv[argc - 1] != NULL && argc < MAX_TOKENS) {
// Check if the next token is 0 (end of string) strlen doesn't work here
if (*next == 0) {