Received: from eggs.gnu.org ([209.51.188.92]:59686) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1hM69n-0004cd-4g for qemu-devel@nongnu.org; Thu, 02 May 2019 03:29:27 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hM69g-0002c2-Re for qemu-devel@nongnu.org; Thu, 02 May 2019 03:29:22 -0400 Received: from mail-wr1-x442.google.com ([2a00:1450:4864:20::442]:33716) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hM69Y-0000iz-DC for qemu-devel@nongnu.org; Thu, 02 May 2019 03:29:13 -0400 Received: by mail-wr1-x442.google.com with SMTP id e28so1840500wra.0 for ; Thu, 02 May 2019 00:27:31 -0700 (PDT) From: Jon Doron Date: Thu, 2 May 2019 10:26:35 +0300 Message-Id: <20190502072641.4667-22-arilou@gmail.com> In-Reply-To: <20190502072641.4667-1-arilou@gmail.com> References: <20190502072641.4667-1-arilou@gmail.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PATCH v8 21/27] gdbstub: Clear unused variables in gdb_handle_packet List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: alex.bennee@linaro.org, liran.alon@oracle.com, Jon Doron Signed-off-by: Jon Doron --- gdbstub.c | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) diff --git a/gdbstub.c b/gdbstub.c index d678191705..8bdfae4b29 100644 --- a/gdbstub.c +++ b/gdbstub.c @@ -2259,17 +2259,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; @@ -2486,8 +2480,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; } -- 2.20.1