From 2616686975726c0a5dec65e7bf56758b8887ef05 Mon Sep 17 00:00:00 2001 From: OmniTechnoMancer Date: Sat, 9 Mar 2024 17:30:20 +0000 Subject: [PATCH] gdb_main: Convert exec_v_attach to read_hex32 Replace use of sscanf with read_hex32, this one is very straightforward. --- src/gdb_main.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gdb_main.c b/src/gdb_main.c index 1651c07940e..4c8c1de9f4b 100644 --- a/src/gdb_main.c +++ b/src/gdb_main.c @@ -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) {