From d64a48b7fcf218da33f97cba9ec3339e78902e76 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Thu, 20 Dec 2018 23:05:02 +0200 Subject: [PATCH] added check Fi and Di --- client/cmdsmartcard.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/client/cmdsmartcard.c b/client/cmdsmartcard.c index 8408b03ce..e4c161153 100644 --- a/client/cmdsmartcard.c +++ b/client/cmdsmartcard.c @@ -675,10 +675,14 @@ int CmdSmartInfo(const char *Cmd){ PrintAndLogEx(NORMAL, "Di=%d", Di); PrintAndLogEx(NORMAL, "Fi=%d", Fi); PrintAndLogEx(NORMAL, "F=%.1f MHz", F); - PrintAndLogEx(NORMAL, "Cycles/ETU=%d", Fi/Di); - PrintAndLogEx(NORMAL, "%.1f bits/sec at 4MHz", (float)4000000 / (Fi/Di)); - PrintAndLogEx(NORMAL, "%.1f bits/sec at Fmax=%.1fMHz", (F * 1000000) / (Fi/Di), F); - + if (Di && Fi) { + PrintAndLogEx(NORMAL, "Cycles/ETU=%d", Fi/Di); + PrintAndLogEx(NORMAL, "%.1f bits/sec at 4MHz", (float)4000000 / (Fi/Di)); + PrintAndLogEx(NORMAL, "%.1f bits/sec at Fmax=%.1fMHz", (F * 1000000) / (Fi/Di), F); + } else { + PrintAndLogEx(WARNING, "Di or Fi is RFU."); + }; + return 0; }