From a33ad8f9bf92d144285769a7d17891c595365fa2 Mon Sep 17 00:00:00 2001 From: Werner Koch Date: Thu, 16 Nov 2023 17:04:02 +0100 Subject: [PATCH] scd: Minor debug output tweak * scd/apdu.c (send_le): Do not dump "[all zero]" if tehre is no data. * scd/iso7816.c (iso7816_select_mf): Cosmetic fix. --- scd/apdu.c | 4 +++- scd/iso7816.c | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/scd/apdu.c b/scd/apdu.c index deb1134e6..7f3c320d2 100644 --- a/scd/apdu.c +++ b/scd/apdu.c @@ -3049,7 +3049,9 @@ send_le (int slot, int class, int ins, int p0, int p1, sw, (unsigned int)resultlen); if ( !retbuf && (sw == SW_SUCCESS || (sw & 0xff00) == SW_MORE_DATA)) { - if (all_zero_p (result, resultlen)) + if (!resultlen) + ; + else if (all_zero_p (result, resultlen)) log_debug (" dump: [all zero]\n"); else log_printhex (result, resultlen, " dump:"); diff --git a/scd/iso7816.c b/scd/iso7816.c index 47e16056c..703f1fdab 100644 --- a/scd/iso7816.c +++ b/scd/iso7816.c @@ -166,7 +166,7 @@ iso7816_select_mf (int slot) { int sw; - sw = apdu_send_simple (slot, 0, 0x00, CMD_SELECT_FILE, 0x000, 0x0c, -1, NULL); + sw = apdu_send_simple (slot, 0, 0x00, CMD_SELECT_FILE, 0x00, 0x0c, -1, NULL); return map_sw (sw); }