From: simon qian Date: Thu, 13 Jan 2011 07:25:22 +0000 (+0100) Subject: transport: fix LOG_DEBUG gaffe X-Git-Tag: v0.5.0-rc1~217 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=8eb92c7e99c018c1cb48be76b0c9736b6c64cba9;p=openocd transport: fix LOG_DEBUG gaffe LOG_DEBUG() arguments are only evaluated when DEBUG logging is enabled, do not use arguments that have side effects like foo++. Signed-off-by: Øyvind Harboe --- diff --git a/src/jtag/transport.c b/src/jtag/transport.c index 5033ebc6..f570103c 100644 --- a/src/jtag/transport.c +++ b/src/jtag/transport.c @@ -125,8 +125,10 @@ int allow_transports(struct command_context *ctx, const char **vector) } else { /* guard against user config errors */ LOG_WARNING("must select a transport."); - while (*vector) - LOG_DEBUG("allow transport '%s'", *vector++); + while (*vector) { + LOG_DEBUG("allow transport '%s'", *vector); + vector++; + } return ERROR_OK; } }