From: roel@libnfc.org Date: Thu, 28 Feb 2013 22:33:31 +0000 (+0000) Subject: fixed stupid 64-bit formatting for x86/amd64 and unix/windows - part2 X-Git-Tag: v1.0.0~130^2~9 X-Git-Url: https://git.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/1a07fd510d6b4c9267b589123143236458c8f9ea?hp=125a98a1102cc27cefeba77f6d37542c1c475c52 fixed stupid 64-bit formatting for x86/amd64 and unix/windows - part2 --- diff --git a/client/cmdhfepa.c b/client/cmdhfepa.c index d9413cf3..6588c393 100644 --- a/client/cmdhfepa.c +++ b/client/cmdhfepa.c @@ -31,13 +31,13 @@ int CmdHFEPACollectPACENonces(const char *Cmd) // delay between requests unsigned int d = 0; - sscanf(Cmd, "%hhu %u %u", &m, &n, &d); + sscanf(Cmd, "%"hhu" %u %u", &m, &n, &d); // values are expected to be > 0 m = m > 0 ? m : 1; n = n > 0 ? n : 1; - PrintAndLog("Collecting %u %hhu-byte nonces", n, m); + PrintAndLog("Collecting %u %"hhu"-byte nonces", n, m); PrintAndLog("Start: %u", time(NULL)); // repeat n times for (unsigned int i = 0; i < n; i++) { diff --git a/client/cmdhflegic.c b/client/cmdhflegic.c index 2719029a..ebc75f79 100644 --- a/client/cmdhflegic.c +++ b/client/cmdhflegic.c @@ -324,7 +324,7 @@ int CmdLegicRfSim(const char *Cmd) c.arg[0] = 6; c.arg[1] = 3; c.arg[2] = 0; - sscanf(Cmd, " %lli %lli %lli", &c.arg[0], &c.arg[1], &c.arg[2]); + sscanf(Cmd, " %"lli" %"lli" %"lli, &c.arg[0], &c.arg[1], &c.arg[2]); SendCommand(&c); return 0; } @@ -344,7 +344,7 @@ int CmdLegicRfWrite(const char *Cmd) int CmdLegicRfFill(const char *Cmd) { UsbCommand cmd ={CMD_WRITER_LEGIC_RF}; - int res = sscanf(Cmd, " 0x%llx 0x%llx 0x%llx", &cmd.arg[0], &cmd.arg[1], &cmd.arg[2]); + int res = sscanf(Cmd, " 0x%"llx" 0x%"llx" 0x%"llx, &cmd.arg[0], &cmd.arg[1], &cmd.arg[2]); if(res != 3) { PrintAndLog("Please specify the offset, length and value as two hex strings"); return -1; diff --git a/client/cmdlf.c b/client/cmdlf.c index dd6281cd..271dcb78 100644 --- a/client/cmdlf.c +++ b/client/cmdlf.c @@ -38,7 +38,7 @@ int CmdLFCommandRead(const char *Cmd) dummy[0]= ' '; UsbCommand c = {CMD_MOD_THEN_ACQUIRE_RAW_ADC_SAMPLES_125K}; - sscanf(Cmd, "%lli %lli %lli %s %s", &c.arg[0], &c.arg[1], &c.arg[2], (char *) &c.d.asBytes,(char *) &dummy+1); + sscanf(Cmd, "%"lli" %"lli" %"lli" %s %s", &c.arg[0], &c.arg[1], &c.arg[2],(char*)(&c.d.asBytes),(char*)(&dummy+1)); // in case they specified 'h' strcpy((char *)&c.d.asBytes + strlen((char *)c.d.asBytes), dummy); SendCommand(&c); diff --git a/client/proxmark3.h b/client/proxmark3.h index 0bf5a9eb..eebaa495 100644 --- a/client/proxmark3.h +++ b/client/proxmark3.h @@ -15,6 +15,8 @@ #define __STDC_FORMAT_MACROS #include #define llx PRIx64 +#define lli PRIi64 +#define hhu PRIu8 #include #include "usb_cmd.h"