X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/blobdiff_plain/cc4c8fd6cf06a0a305f899f29434a0b492ead0c8..e719470c461e38fb3ad99416d06fa1b5b19ff357:/client/cmdhflegic.c diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index ccdfa1da..731cead1 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -527,8 +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 @@ 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 @@ int CmdLegicCalcCrc8(const char *Cmd){ break; } - if (data != NULL) free(data); + if (data) free(data); return 0; }