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;
}
}
//Validations
if (errors){
- if (data != NULL) free(data);
+ if (data) free(data);
return usage_legic_calccrc8();
}
break;
}
- if (data != NULL) free(data);
+ if (data) free(data);
return 0;
}