fix(msh): Fixed command identification errors.

1.Originally, "strncmp" was used, and the length was command length, and when the input was the same as the length of the command, the condition was passed incorrectly, causing a problem (feedback from "下一站 还是站").
This commit is contained in:
MacRsh
2024-12-19 23:34:29 +08:00
parent 1c37dceb14
commit 8cfcbfedf8

View File

@@ -235,7 +235,7 @@ MR_INLINE void msh_parse_cmd(void)
for (const struct mr_msh_cmd *msh_cmd = ((&_mr_msh_cmd_start) + 1);
msh_cmd < &_mr_msh_cmd_end;
msh_cmd++) {
if (strncmp(msh_cmd->name, msh.buf, strlen(msh_cmd->name)) != 0) {
if (strcmp(msh_cmd->name, msh.buf) != 0) {
continue;
}