From 7c1e6128c02853bd266eba2661cd172fbe962039 Mon Sep 17 00:00:00 2001 From: merlokk Date: Fri, 28 Sep 2018 21:34:31 +0300 Subject: [PATCH] add new argtable logic to emv commands and small fix --- client/cliparser/cliparser.c | 2 +- client/emv/cmdemv.c | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/client/cliparser/cliparser.c b/client/cliparser/cliparser.c index 5e3dda95..56be2ca6 100644 --- a/client/cliparser/cliparser.c +++ b/client/cliparser/cliparser.c @@ -166,7 +166,7 @@ int CLIParamHexToBuf(struct arg_str *argstr, uint8_t *data, int maxdatalen, int } buf[ibuf] = 0; - if (!len) + if (!ibuf) return 0; switch(param_gethex_to_eol(buf, 0, data, maxdatalen, datalen)) { diff --git a/client/emv/cmdemv.c b/client/emv/cmdemv.c index 93635f85..eafb368d 100644 --- a/client/emv/cmdemv.c +++ b/client/emv/cmdemv.c @@ -49,7 +49,7 @@ int CmdHFEMVSelect(const char *cmd) { arg_lit0("kK", "keep", "keep field for next command"), arg_lit0("aA", "apdu", "show APDU reqests and responses"), arg_lit0("tT", "tlv", "TLV decode results"), - arg_str0(NULL, NULL, "", NULL), + arg_strx0(NULL, NULL, "", NULL), arg_param_end }; CLIExecWithReturn(cmd, argtable, true); @@ -193,7 +193,7 @@ int CmdHFEMVGPO(const char *cmd) { arg_lit0("mM", "make", "make PDOLdata from PDOL (tag 9F38) and parameters (NOT WORK!!!)"), arg_lit0("aA", "apdu", "show APDU reqests and responses"), arg_lit0("tT", "tlv", "TLV decode results of selected applets"), - arg_str0(NULL, NULL, "", NULL), + arg_strx0(NULL, NULL, "", NULL), arg_param_end }; CLIExecWithReturn(cmd, argtable, true); @@ -281,7 +281,7 @@ int CmdHFEMVReadRecord(const char *cmd) { arg_lit0("kK", "keep", "keep field ON for next command"), arg_lit0("aA", "apdu", "show APDU reqests and responses"), arg_lit0("tT", "tlv", "TLV decode results of selected applets"), - arg_str1(NULL, NULL, "", NULL), + arg_strx1(NULL, NULL, "", NULL), arg_param_end }; CLIExecWithReturn(cmd, argtable, true); @@ -335,7 +335,7 @@ int CmdHFEMVAC(const char *cmd) { arg_str0("dD", "decision", "", "Terminal decision. aac - declined, tc - approved, arqc - online authorisation requested"), arg_lit0("aA", "apdu", "show APDU reqests and responses"), arg_lit0("tT", "tlv", "TLV decode results of selected applets"), - arg_str1(NULL, NULL, "", NULL), + arg_strx1(NULL, NULL, "", NULL), arg_param_end }; CLIExecWithReturn(cmd, argtable, false); @@ -457,7 +457,7 @@ int CmdHFEMVInternalAuthenticate(const char *cmd) { arg_lit0("kK", "keep", "keep field ON for next command"), arg_lit0("aA", "apdu", "show APDU reqests and responses"), arg_lit0("tT", "tlv", "TLV decode results of selected applets"), - arg_str1(NULL, NULL, "", NULL), + arg_strx1(NULL, NULL, "", NULL), arg_param_end }; CLIExecWithReturn(cmd, argtable, false);