Skip to content

Commit

Permalink
command: fixed platform-specific command processing
Browse files Browse the repository at this point in the history
  • Loading branch information
Misaka0x2730 committed Jul 28, 2024
1 parent 5c33d32 commit 763e057
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/command.c
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,7 @@ const command_s cmd_list[] = {
};

#ifdef PLATFORM_HAS_CUSTOM_COMMANDS
extern const command_s platform_cmd_list[];
extern const command_s *platform_cmd_list;
#endif

bool connect_assert_nrst;
Expand Down Expand Up @@ -167,7 +167,7 @@ int command_process(target_s *const t, char *const cmd_buffer)

#ifdef PLATFORM_HAS_CUSTOM_COMMANDS
for (const command_s *cmd = platform_cmd_list; cmd->cmd; ++cmd) {
if ((argc == 0) || !strncmp(argv[0], cmd->cmd, strlen(argv[0])))
if (!strncmp(argv[0], cmd->cmd, strlen(argv[0])))
return !cmd->handler(t, argc, argv);
}
#endif
Expand Down

0 comments on commit 763e057

Please sign in to comment.