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>
This commit is contained in:
simon qian 2011-01-13 08:25:22 +01:00 committed by Øyvind Harboe
parent 8684bd1342
commit 8eb92c7e99
1 changed files with 4 additions and 2 deletions

View File

@ -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;
}
}