Indent after last commit.

This commit is contained in:
Romain Tartiere 2010-08-31 12:00:56 +00:00
parent 7ba83f79ed
commit 5aafbc9a48

View file

@ -227,43 +227,43 @@ main(int argc, char *argv[])
} else { } else {
// Create a MAD and mark unaccessible sectors in the card // Create a MAD and mark unaccessible sectors in the card
if (!(mad = mad_new ((freefare_get_tag_type (tags[i]) == CLASSIC_4K) ? 2 : 1))) { if (!(mad = mad_new ((freefare_get_tag_type (tags[i]) == CLASSIC_4K) ? 2 : 1))) {
perror ("mad_new"); perror ("mad_new");
error = 1; error = 1;
goto error; goto error;
} }
MifareClassicSectorNumber max_s; MifareClassicSectorNumber max_s;
switch (freefare_get_tag_type (tags[i])) { switch (freefare_get_tag_type (tags[i])) {
case CLASSIC_1K: case CLASSIC_1K:
max_s = 15; max_s = 15;
break; break;
case CLASSIC_4K: case CLASSIC_4K:
max_s = 39; max_s = 39;
break; break;
default: default:
/* Keep compiler quiet */ /* Keep compiler quiet */
break; break;
} }
MifareClassicKey transport_key = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff }; MifareClassicKey transport_key = { 0xff, 0xff, 0xff, 0xff, 0xff, 0xff };
// Mark unusable sectors as so // Mark unusable sectors as so
for (size_t s = max_s; s; s--) { for (size_t s = max_s; s; s--) {
if (s == 0x10) continue; if (s == 0x10) continue;
if (!search_sector_key (tags[i], s, &(card_write_keys[s].key), &(card_write_keys[s].type))) { if (!search_sector_key (tags[i], s, &(card_write_keys[s].key), &(card_write_keys[s].type))) {
mad_set_aid (mad, s, mad_defect_aid); mad_set_aid (mad, s, mad_defect_aid);
} else if ((memcmp (card_write_keys[s].key, transport_key, sizeof (transport_key)) != 0) && } else if ((memcmp (card_write_keys[s].key, transport_key, sizeof (transport_key)) != 0) &&
(card_write_keys[s].type != MFC_KEY_A)) { (card_write_keys[s].type != MFC_KEY_A)) {
// Revert to transport configuration // Revert to transport configuration
if (mifare_classic_format_sector (tags[i], s) < 0) { if (mifare_classic_format_sector (tags[i], s) < 0) {
perror ("mifare_classic_format_sector"); perror ("mifare_classic_format_sector");
error = 1; error = 1;
goto error; goto error;
}
} }
} }
} }
}
MifareClassicSectorNumber *sectors = mifare_application_alloc (mad, mad_nfcforum_aid, encoded_size); MifareClassicSectorNumber *sectors = mifare_application_alloc (mad, mad_nfcforum_aid, encoded_size);
if (!sectors) { if (!sectors) {