fix overwriting of still-needed value (refs #487)
this fixes a bug that was introduced in blackmagic PR #475 which lead to firmware crashes when connecting to a BMP more than once without a power-cycle.
This commit is contained in:
parent
589d297d20
commit
02b2fdb2ae
|
@ -110,8 +110,9 @@ void target_add_commands(target *t, const struct command_s *cmds, const char *na
|
|||
}
|
||||
|
||||
if (t->commands) {
|
||||
for (tc = t->commands; tc->next; tc = tc->next);
|
||||
tc->next = tc;
|
||||
struct target_command_s *tail;
|
||||
for (tail = t->commands; tail->next; tail = tail->next);
|
||||
tail->next = tc;
|
||||
} else {
|
||||
t->commands = tc;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue