nfc-mfultralight: Remove whitespaces

Clean up some stray unintended whitespaces. This patch does not
introduce any binary changes.

Signed-off-by: Olliver Schinagl <oliver@schinagl.nl>
This commit is contained in:
Olliver Schinagl 2016-05-11 09:35:48 +02:00
parent ecd0e59b5c
commit 4b8871fd8f

View file

@ -183,7 +183,7 @@ unlock_card(void)
static bool check_magic() { static bool check_magic() {
bool bFailure = false; bool bFailure = false;
int uid_data; int uid_data;
for (uint32_t page = 0; page <= 1; page++) { for (uint32_t page = 0; page <= 1; page++) {
// Show if the readout went well // Show if the readout went well
@ -197,27 +197,27 @@ static bool check_magic() {
} }
uid_data = 0x00000000; uid_data = 0x00000000;
memcpy(mp.mpd.abtData, &uid_data, sizeof uid_data); memcpy(mp.mpd.abtData, &uid_data, sizeof uid_data);
memset(mp.mpd.abtData + 4, 0, 12); memset(mp.mpd.abtData + 4, 0, 12);
//Force the write without checking for errors - otherwise the writes to the sector 0 seem to complain //Force the write without checking for errors - otherwise the writes to the sector 0 seem to complain
nfc_initiator_mifare_cmd(pnd, MC_WRITE, page, &mp); nfc_initiator_mifare_cmd(pnd, MC_WRITE, page, &mp);
} }
//Check that the ID is now set to 0x000000000000 //Check that the ID is now set to 0x000000000000
if (nfc_initiator_mifare_cmd(pnd, MC_READ, 0, &mp)) { if (nfc_initiator_mifare_cmd(pnd, MC_READ, 0, &mp)) {
//printf("%u", mp.mpd.abtData); //printf("%u", mp.mpd.abtData);
bool result = true; bool result = true;
for(int i = 0; i <= 7; i++) { for(int i = 0; i <= 7; i++) {
if (mp.mpd.abtData[i] != 0x00) result = false; if (mp.mpd.abtData[i] != 0x00) result = false;
} }
if (result) { if (result) {
return true; return true;
} }
} }
//Initially check if we can unlock via the MF method //Initially check if we can unlock via the MF method
if (unlock_card()) { if (unlock_card()) {
@ -238,7 +238,7 @@ write_card(bool write_otp, bool write_lock, bool write_uid)
char buffer[BUFSIZ]; char buffer[BUFSIZ];
if (!write_otp) { if (!write_otp) {
printf("Write OTP bytes ? [yN] "); printf("Write OTP bytes ? [yN] ");
if (!fgets(buffer, BUFSIZ, stdin)) { if (!fgets(buffer, BUFSIZ, stdin)) {
ERR("Unable to read standard input."); ERR("Unable to read standard input.");
@ -246,7 +246,7 @@ write_card(bool write_otp, bool write_lock, bool write_uid)
write_otp = ((buffer[0] == 'y') || (buffer[0] == 'Y')); write_otp = ((buffer[0] == 'y') || (buffer[0] == 'Y'));
} }
if (!write_lock) { if (!write_lock) {
printf("Write Lock bytes ? [yN] "); printf("Write Lock bytes ? [yN] ");
if (!fgets(buffer, BUFSIZ, stdin)) { if (!fgets(buffer, BUFSIZ, stdin)) {
ERR("Unable to read standard input."); ERR("Unable to read standard input.");
@ -254,7 +254,7 @@ write_card(bool write_otp, bool write_lock, bool write_uid)
write_lock = ((buffer[0] == 'y') || (buffer[0] == 'Y')); write_lock = ((buffer[0] == 'y') || (buffer[0] == 'Y'));
} }
if (!write_uid) { if (!write_uid) {
printf("Write UID bytes (only for special writeable UID cards) ? [yN] "); printf("Write UID bytes (only for special writeable UID cards) ? [yN] ");
if (!fgets(buffer, BUFSIZ, stdin)) { if (!fgets(buffer, BUFSIZ, stdin)) {
ERR("Unable to read standard input."); ERR("Unable to read standard input.");
@ -453,7 +453,7 @@ main(int argc, const char *argv[])
ERR("Unable to determine operating mode"); ERR("Unable to determine operating mode");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
nfc_context *context; nfc_context *context;
nfc_init(&context); nfc_init(&context);
if (context == NULL) { if (context == NULL) {