From 8eb92c7e99c018c1cb48be76b0c9736b6c64cba9 Mon Sep 17 00:00:00 2001 From: simon qian Date: Thu, 13 Jan 2011 08:25:22 +0100 Subject: [PATCH] transport: fix LOG_DEBUG gaffe MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit 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 --- src/jtag/transport.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) 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; } } -- 2.39.5