Skip to content

Commit

Permalink
gdb_main: Convert exec_v_attach to read_hex32
Browse files Browse the repository at this point in the history
Replace use of sscanf with read_hex32, this one is very straightforward.
  • Loading branch information
OmniTechnoMancer authored and OmniTechnoMancer committed Apr 8, 2024
1 parent 5853dfd commit 2616686
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/gdb_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -615,8 +615,8 @@ static void exec_v_attach(const char *packet, const size_t length)
{
(void)length;

uint32_t addr = 0;
if (sscanf(packet, "%08" PRIx32, &addr) == 1) {
uint32_t addr;
if (read_hex32(packet, NULL, &addr, READ_HEX_NO_FOLLOW)) {
/* Attach to remote target processor */
cur_target = target_attach_n(addr, &gdb_controller);
if (cur_target) {
Expand Down

0 comments on commit 2616686

Please sign in to comment.