From: Christian Eggers Date: Mon, 3 Feb 2014 19:13:54 +0000 (+0100) Subject: Remove unneeded zero termination of received packet X-Git-Tag: v0.8.0-rc1~72 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=6fcaa4ae8f78790da8d3fbe05d87c355082febb4;p=openocd Remove unneeded zero termination of received packet v2: removed curly braces around single statement if-block packet[] has already been zero terminated in gdb_input_inner() This change is necessary in order to make packet[] "const". Change-Id: I978bbe52d151a63574db77fb747f596da256d377 Signed-off-by: Christian Eggers Reviewed-on: http://openocd.zylin.com/1922 Tested-by: jenkins Reviewed-by: Spencer Oliver --- diff --git a/src/server/gdb_server.c b/src/server/gdb_server.c index 7bf7319c..40852ab3 100644 --- a/src/server/gdb_server.c +++ b/src/server/gdb_server.c @@ -1522,10 +1522,9 @@ static int gdb_step_continue_packet(struct connection *connection, LOG_DEBUG("-"); - if (packet_size > 1) { - packet[packet_size] = 0; + if (packet_size > 1) address = strtoul(packet + 1, NULL, 16); - } else + else current = 1; gdb_running_type = packet[0];