]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhflegic.c
Merge branch 'master' of https://github.com/iceman1001/proxmark3
[proxmark3-svn] / client / cmdhflegic.c
index ccdfa1da2675d1f73017cf4b0f332229741bea4f..731cead1097a5f80b0c56c104bfe81346b75b702 100644 (file)
@@ -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;
 } 
  
Impressum, Datenschutz