mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
times times times
This commit is contained in:
parent
22f8440183
commit
dae0016bb2
3 changed files with 35 additions and 20 deletions
|
@ -6,8 +6,8 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// Low frequency T55xx commands
|
||||
//-----------------------------------------------------------------------------
|
||||
/* Ensure localtime_r is available even with -std=c99; must be included before
|
||||
*/
|
||||
|
||||
// ensure localtime_r is available even with -std=c99; must be included before
|
||||
#if !defined(_WIN32)
|
||||
#define _POSIX_C_SOURCE 200112L
|
||||
#endif
|
||||
|
@ -1205,10 +1205,15 @@ static int CmdT55xxReadTrace(const char *Cmd) {
|
|||
si += 5;
|
||||
data.dw = PackBits(si, 15, DemodBuffer);
|
||||
|
||||
struct tm *tm = NULL;
|
||||
time_t now = time(NULL);
|
||||
localtime_r(&now, tm);
|
||||
if (data.year > tm->tm_year - 110)
|
||||
struct tm *ct, tm_buf;
|
||||
time_t now = time(NULL);
|
||||
#if defined(_WIN32)
|
||||
ct = localtime_s(&tm_buf, &now) == 0 ? &tm_buf : NULL;
|
||||
#else
|
||||
ct = localtime_r(&now, &tm_buf);
|
||||
#endif
|
||||
|
||||
if (data.year > ct->tm_year - 110)
|
||||
data.year += 2000;
|
||||
else
|
||||
data.year += 2010;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue