diff --git a/libs/libc/gdbstub/lib_gdbstub.c b/libs/libc/gdbstub/lib_gdbstub.c index ace13079380e5..2da89228e3f15 100644 --- a/libs/libc/gdbstub/lib_gdbstub.c +++ b/libs/libc/gdbstub/lib_gdbstub.c @@ -1376,11 +1376,11 @@ static int gdb_query(FAR struct gdb_state_s *state) { #ifdef CONFIG_ARCH_HAVE_DEBUG state->pkt_len = sprintf(state->pkt_buf, - "hwbreak+;PacketSize=%x", + "hwbreak+;PacketSize=%zx", sizeof(state->pkt_buf)); #else state->pkt_len = sprintf(state->pkt_buf, - "PacketSize=%x", + "PacketSize=%zx", sizeof(state->pkt_buf)); #endif gdb_send_packet(state); @@ -1609,7 +1609,7 @@ static int gdb_send_stop(FAR struct gdb_state_s *state, int stopreason, case GDB_STOPREASON_CTRLC: default: - ret = sprintf(state->pkt_buf, "T05thread:%d;", state->pid + 1); + ret = sprintf(state->pkt_buf, "T05thread:%x;", state->pid + 1); } if (ret < 0)