diff options
author | simon qian <simonqian.openocd@gmail.com> | 2011-01-13 08:25:22 +0100 |
---|---|---|
committer | Øyvind Harboe <oyvind.harboe@zylin.com> | 2011-01-13 08:28:29 +0100 |
commit | 8eb92c7e99c018c1cb48be76b0c9736b6c64cba9 (patch) | |
tree | 9ee4f076a4ffc1a94c5a0bb9b141ef133382408c /src | |
parent | 8684bd1342e2a2e79118397df5e35a6b85e0b8d0 (diff) | |
download | openocd+libswd-8eb92c7e99c018c1cb48be76b0c9736b6c64cba9.tar.gz openocd+libswd-8eb92c7e99c018c1cb48be76b0c9736b6c64cba9.tar.bz2 openocd+libswd-8eb92c7e99c018c1cb48be76b0c9736b6c64cba9.tar.xz openocd+libswd-8eb92c7e99c018c1cb48be76b0c9736b6c64cba9.zip |
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 <oyvind.harboe@zylin.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/jtag/transport.c | 6 |
1 files 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; } } |