mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-02-25 00:25:48 +08:00
fix more printf api warnings/bugs
This commit is contained in:
parent
020141726e
commit
d588b04537
7 changed files with 12 additions and 12 deletions
|
@ -50,7 +50,7 @@ static int CmdHFEPACollectPACENonces(const char *Cmd) {
|
|||
|
||||
// check if command failed
|
||||
if (resp.oldarg[0] != 0) {
|
||||
PrintAndLogEx(FAILED, "Error in step %" PRId64 ", Return code: %" PRId64, resp.oldarg[0], (int)resp.oldarg[1]);
|
||||
PrintAndLogEx(FAILED, "Error in step %" PRId64 ", Return code: %" PRId64, resp.oldarg[0], resp.oldarg[1]);
|
||||
} else {
|
||||
size_t nonce_length = resp.oldarg[1];
|
||||
char *nonce = (char *) calloc(2 * nonce_length + 1, sizeof(uint8_t));
|
||||
|
|
|
@ -408,7 +408,7 @@ static int CmdHFFelicaDumpLite(const char *Cmd) {
|
|||
return 0;
|
||||
}
|
||||
|
||||
PrintAndLogEx(SUCCESS, "Recorded Activity (trace len = %"PRIu64" bytes)", tracelen);
|
||||
PrintAndLogEx(SUCCESS, "Recorded Activity (trace len = %"PRIu32" bytes)", tracelen);
|
||||
|
||||
print_hex_break(trace, tracelen, 32);
|
||||
printSep();
|
||||
|
|
|
@ -2487,7 +2487,7 @@ static int CmdHFiClassLookUp(const char *Cmd) {
|
|||
case 'u':
|
||||
param_gethex_ex(Cmd, cmdp + 1, CSN, &len);
|
||||
if (len >> 1 != sizeof(CSN)) {
|
||||
PrintAndLogEx(WARNING, "Wrong CSN length, expected %d got [%d]", sizeof(CSN), len >> 1);
|
||||
PrintAndLogEx(WARNING, "Wrong CSN length, expected %zu got [%d]", sizeof(CSN), len >> 1);
|
||||
errors = true;
|
||||
}
|
||||
cmdp += 2;
|
||||
|
@ -2495,7 +2495,7 @@ static int CmdHFiClassLookUp(const char *Cmd) {
|
|||
case 'm':
|
||||
param_gethex_ex(Cmd, cmdp + 1, MACS, &len);
|
||||
if (len >> 1 != sizeof(MACS)) {
|
||||
PrintAndLogEx(WARNING, "Wrong MACS length, expected %d got [%d] ", sizeof(MACS), len >> 1);
|
||||
PrintAndLogEx(WARNING, "Wrong MACS length, expected %zu got [%d] ", sizeof(MACS), len >> 1);
|
||||
errors = true;
|
||||
} else {
|
||||
memcpy(MAC_TAG, MACS + 4, 4);
|
||||
|
|
|
@ -401,7 +401,7 @@ int AskEm410xDecode(bool verbose, uint32_t *hi, uint64_t *lo) {
|
|||
else if (ans == -4)
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Em410x preamble not found");
|
||||
else if (ans == -5)
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Em410x Size not correct: %d", size);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Em410x Size not correct: %zu", size);
|
||||
else if (ans == -6)
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - Em410x parity failed");
|
||||
|
||||
|
@ -692,7 +692,7 @@ static int CmdEM410xWrite(const char *Cmd) {
|
|||
// the clock rate in bits 8-15 of the card value
|
||||
card = (card & 0xFF) | ((clock1 << 8) & 0xFF00);
|
||||
} else if (card == 0) {
|
||||
PrintAndLogEx(SUCCESS, "Writing %s tag with UID 0x%010" PRIx64, "(clock rate: %d)", "T5555", id, clock1);
|
||||
PrintAndLogEx(SUCCESS, "Writing %s tag with UID 0x%010" PRIx64 "(clock rate: %d)", "T5555", id, clock1);
|
||||
card = (card & 0xFF) | ((clock1 << 8) & 0xFF00);
|
||||
} else {
|
||||
PrintAndLogEx(FAILED, "Error! Bad card type selected.\n");
|
||||
|
|
|
@ -216,7 +216,7 @@ static int CmdFdxDemod(const char *Cmd) {
|
|||
// remove marker bits (1's every 9th digit after preamble) (pType = 2)
|
||||
size = removeParity(DemodBuffer, 11, 9, 2, 117);
|
||||
if (size != 104) {
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - FDX-B error removeParity: %d", size);
|
||||
PrintAndLogEx(DEBUG, "DEBUG: Error - FDX-B error removeParity: %zu", size);
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
||||
|
|
|
@ -373,7 +373,7 @@ static int CmdUsartBtFactory(const char *Cmd) {
|
|||
if (strcmp((char *)data, "OKsetname") == 0) {
|
||||
PrintAndLogEx(SUCCESS, "Name set to " _GREEN_("PM3_RDV4.0"));
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Unexpected response to AT+NAME: " _YELLOW_("%.*s"), len, data);
|
||||
PrintAndLogEx(WARNING, "Unexpected response to AT+NAME: " _YELLOW_("%.*s"), (int)len, data);
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Lost contact with add-on, please try again");
|
||||
|
@ -409,7 +409,7 @@ static int CmdUsartBtFactory(const char *Cmd) {
|
|||
if (strcmp((char *)data, "OKsetPIN") == 0) {
|
||||
PrintAndLogEx(SUCCESS, "PIN set to " _GREEN_("1234"));
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Unexpected response to AT+PIN: " _YELLOW_("%.*s"), len, data);
|
||||
PrintAndLogEx(WARNING, "Unexpected response to AT+PIN: " _YELLOW_("%.*s"), (int)len, data);
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Lost contact with add-on, please try again");
|
||||
|
@ -429,7 +429,7 @@ static int CmdUsartBtFactory(const char *Cmd) {
|
|||
if (strcmp((char *)data, "OK None") == 0) {
|
||||
PrintAndLogEx(SUCCESS, "Parity set to " _GREEN_("None"));
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Unexpected response to AT+P: " _YELLOW_("%.*s"), len, data);
|
||||
PrintAndLogEx(WARNING, "Unexpected response to AT+P: " _YELLOW_("%.*s"), (int)len, data);
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Lost contact with add-on, please try again");
|
||||
|
@ -449,7 +449,7 @@ static int CmdUsartBtFactory(const char *Cmd) {
|
|||
if (strcmp((char *)data, "OK" BTADDON_BAUD_NUM) == 0) {
|
||||
PrintAndLogEx(SUCCESS, "Baudrate set to " _GREEN_(BTADDON_BAUD_NUM));
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Unexpected response to AT+BAUD: " _YELLOW_("%.*s"), len, data);
|
||||
PrintAndLogEx(WARNING, "Unexpected response to AT+BAUD: " _YELLOW_("%.*s"), (int)len, data);
|
||||
}
|
||||
} else {
|
||||
PrintAndLogEx(WARNING, "Lost contact with add-on, please try again");
|
||||
|
|
|
@ -211,7 +211,7 @@ static int ndefDecodeSig(uint8_t *sig, size_t siglen) {
|
|||
if ((indx <= siglen) && certURI) {
|
||||
size_t inturilen = (sig[indx] << 8) + sig[indx + 1];
|
||||
indx += 2;
|
||||
PrintAndLogEx(NORMAL, "\tcertificate uri [%zu]: %.*s", inturilen, inturilen, &sig[indx]);
|
||||
PrintAndLogEx(NORMAL, "\tcertificate uri [%zu]: %.*s", inturilen, (int)inturilen, &sig[indx]);
|
||||
}
|
||||
|
||||
return 0;
|
||||
|
|
Loading…
Reference in a new issue