diff options
author | Jon Doron <arilou@gmail.com> | 2019-05-29 09:41:47 +0300 |
---|---|---|
committer | Alex Bennée <alex.bennee@linaro.org> | 2019-06-12 17:53:23 +0100 |
commit | 3f1cbac73a441c518e27184bf24bc56796f4ab5a (patch) | |
tree | 75bc5be155912a7e59786db4365a8e0c2a02898f | |
parent | 7009d579240035d9ba981940bf945d8b633625dd (diff) |
gdbstub: Clear unused variables in gdb_handle_packet
Signed-off-by: Jon Doron <arilou@gmail.com>
Reviewed-by: Alex Bennée <alex.bennee@linaro.org>
Message-Id: <20190529064148.19856-20-arilou@gmail.com>
Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
-rw-r--r-- | gdbstub.c | 11 |
1 files changed, 2 insertions, 9 deletions
@@ -2288,17 +2288,11 @@ static void handle_target_halt(GdbCmdContext *gdb_ctx, void *user_ctx) static int gdb_handle_packet(GDBState *s, const char *line_buf) { - const char *p; - int ch; - uint8_t mem_buf[MAX_PACKET_LENGTH]; - char buf[sizeof(mem_buf) + 1 /* trailing NUL */]; const GdbCmdParseEntry *cmd_parser = NULL; trace_gdbstub_io_command(line_buf); - p = line_buf; - ch = *p++; - switch(ch) { + switch (line_buf[0]) { case '!': put_packet(s, "OK"); break; @@ -2515,8 +2509,7 @@ static int gdb_handle_packet(GDBState *s, const char *line_buf) break; default: /* put empty packet */ - buf[0] = '\0'; - put_packet(s, buf); + put_packet(s, ""); break; } |