diff --git a/src/tools/cardos-tool.c b/src/tools/cardos-tool.c index f62042ae..aa6ba477 100644 --- a/src/tools/cardos-tool.c +++ b/src/tools/cardos-tool.c @@ -1132,8 +1132,11 @@ int main(int argc, char *const argv[]) sc_strerror(r)); return 1; } - if (verbose > 0) + + if (verbose > 1) { ctx->debug = verbose; + ctx->debug_file = stderr; + } if (opt_driver != NULL) { err = sc_set_card_driver(ctx, opt_driver); diff --git a/src/tools/cryptoflex-tool.c b/src/tools/cryptoflex-tool.c index 4e0a6ddf..4e02b586 100644 --- a/src/tools/cryptoflex-tool.c +++ b/src/tools/cryptoflex-tool.c @@ -1045,7 +1045,10 @@ int main(int argc, char * const argv[]) return 1; } - ctx->debug = verbose; + if (verbose > 1) { + ctx->debug = verbose; + ctx->debug_file = stderr; + } err = util_connect_card(ctx, &card, opt_reader, opt_wait, verbose); printf("Using card driver: %s\n", card->driver->name); diff --git a/src/tools/opensc-explorer.c b/src/tools/opensc-explorer.c index 727a89cd..54e8e346 100644 --- a/src/tools/opensc-explorer.c +++ b/src/tools/opensc-explorer.c @@ -1192,7 +1192,7 @@ static int do_debug(int argc, char **argv) printf("Debug level set to %d\n", i); ctx->debug = i; if (i) { - ctx->debug_file = stdout; + ctx->debug_file = stderr; } else { ctx->debug_file = NULL; } @@ -1604,8 +1604,11 @@ int main(int argc, char * const argv[]) fprintf(stderr, "Failed to establish context: %s\n", sc_strerror(r)); return 1; } - if (verbose > 1) - ctx->debug = verbose-1; + + if (verbose > 1) { + ctx->debug = verbose; + ctx->debug_file = stderr; + } if (opt_driver != NULL) { err = sc_set_card_driver(ctx, opt_driver); diff --git a/src/tools/opensc-tool.c b/src/tools/opensc-tool.c index da215397..a55cab6b 100644 --- a/src/tools/opensc-tool.c +++ b/src/tools/opensc-tool.c @@ -726,7 +726,12 @@ int main(int argc, char * const argv[]) fprintf(stderr, "Failed to establish context: %s\n", sc_strerror(r)); return 1; } - ctx->debug = verbose; + + if (verbose > 1) { + ctx->debug = verbose; + ctx->debug_file = stderr; + } + if (do_get_conf_entry) { if ((err = opensc_get_conf_entry (opt_conf_entry))) goto end;