make style

This commit is contained in:
Philippe Teuwen 2019-03-15 00:20:42 +01:00
parent 2f2dfd6239
commit b538a67ba3
2 changed files with 27 additions and 27 deletions

View file

@ -358,7 +358,7 @@ static void printHitagConfiguration(uint8_t config) {
// version
strcat(msg, "Coding in HITAG 2 operation: %s");
uint8_t foo = (config & 0x6) >> 1;
switch ( foo ) {
switch (foo) {
case 0:
PrintAndLogEx(SUCCESS, "Version: public mode B, Coding: biphase");
PrintAndLogEx(SUCCESS, msg, (config & 0x1) ? "biphase" : "manchester");
@ -380,9 +380,9 @@ static void printHitagConfiguration(uint8_t config) {
// mode
if (config & 0x8) {
strcat(msg, "Tag is in : " _YELLOW_("Crypto mode") );
strcat(msg, "Tag is in : " _YELLOW_("Crypto mode"));
} else {
strcat(msg, "Tag is in : " _YELLOW_("Password mode") );
strcat(msg, "Tag is in : " _YELLOW_("Password mode"));
}
PrintAndLogEx(SUCCESS, "%s", msg);
memset(msg, 0, sizeof(msg));
@ -407,7 +407,7 @@ static void printHitagConfiguration(uint8_t config) {
// OTP
if (config & 0x40) {
strcat(msg, "Page 3 : read only. Configuration byte and password tag " _RED_("FIXED / IRREVERSIBLE") );
strcat(msg, "Page 3 : read only. Configuration byte and password tag " _RED_("FIXED / IRREVERSIBLE"));
} else {
strcat(msg, "Page 3 : " _GREEN_("read write"));
}
@ -419,7 +419,7 @@ static void printHitagConfiguration(uint8_t config) {
strcat(msg, "Page 1 " _RED_("locked") "\n");
if (config & 0x8) {
strcat(msg + strlen(msg), "Page 2 : " _RED_("locked") );
strcat(msg + strlen(msg), "Page 2 : " _RED_("locked"));
} else {
strcat(msg + strlen(msg), "Page 2 : read only");
}
@ -441,7 +441,7 @@ int CmdLFHitagInfo(const char *Cmd) {
// read block3, get configuration byte.
// common configurations.
printHitagConfiguration( 0x06 );
printHitagConfiguration(0x06);
//printHitagConfiguration( 0x0E );
//printHitagConfiguration( 0x02 );
//printHitagConfiguration( 0x00 );

View file

@ -694,7 +694,7 @@ int binarraytohex(char *target, const size_t targetlen, char *source, size_t src
uint32_t r = 0; // consumed bits
uint8_t w = 0; // wrong bits separator printed
for (size_t s = 0 ; s < srclen; s++) {
if ((source[s]==0) || (source[s]==1)) {
if ((source[s] == 0) || (source[s] == 1)) {
w = 0;
x += (source[s] << (3 - i));
i++;
@ -702,7 +702,7 @@ int binarraytohex(char *target, const size_t targetlen, char *source, size_t src
if (t >= targetlen - 2) return r;
sprintf(target + t, "%X", x);
t++;
r+=4;
r += 4;
x = 0;
i = 0;
}
@ -711,8 +711,8 @@ int binarraytohex(char *target, const size_t targetlen, char *source, size_t src
if (t >= targetlen - 5) return r;
w = 0;
sprintf(target + t, "%X[%i]", x, i);
t+=4;
r+=i;
t += 4;
r += i;
x = 0;
i = 0;
}