From: iceman1001 Date: Tue, 2 Aug 2016 14:06:40 +0000 (+0200) Subject: Merge branch 'master' of https://github.com/iceman1001/proxmark3 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/e719470c461e38fb3ad99416d06fa1b5b19ff357?hp=-c Merge branch 'master' of https://github.com/iceman1001/proxmark3 --- e719470c461e38fb3ad99416d06fa1b5b19ff357 diff --combined client/cmdhflegic.c index da1b20b1,0adf3c59..731cead1 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@@ -527,8 -527,7 +527,7 @@@ int CmdLegicRfRawWrite(const char *Cmd PrintAndLog("# changing the DCF is irreversible #"); PrintAndLog("#####################################"); PrintAndLog("do youe really want to continue? y(es) n(o)"); - scanf(" %c", &answer); - if (answer == 'y' || answer == 'Y') { + if (scanf(" %c", &answer) > 0 && (answer == 'y' || answer == 'Y')) { SendCommand(&c); return 0; } @@@ -612,7 -611,7 +611,7 @@@ int CmdLegicCalcCrc8(const char *Cmd) } //Validations if (errors){ - if (data != NULL) free(data); + if (data) free(data); return usage_legic_calccrc8(); } @@@ -625,7 -624,7 +624,7 @@@ break; } - if (data != NULL) free(data); + if (data) free(data); return 0; }