Skip to content

Commit

Permalink
Merge pull request #185 from GoGoOtaku/issue184
Browse files Browse the repository at this point in the history
Fix readpe date output
  • Loading branch information
GoGoOtaku authored May 5, 2023
2 parents b0e8df0 + 1050df4 commit 2576ebb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/readpe.c
Original file line number Diff line number Diff line change
Expand Up @@ -679,7 +679,8 @@ static void print_coff_header(IMAGE_COFF_HEADER *header)
output("Number of sections", s);

char timestr[40] = "invalid";
struct tm *t = gmtime((time_t *) &header->TimeDateStamp);
const time_t timestamp = header->TimeDateStamp;
struct tm *t = gmtime(&timestamp);
if (t)
strftime(timestr, sizeof(timestr), "%a, %d %b %Y %H:%M:%S UTC", t);
snprintf(s, MAX_MSG, "%" PRIu32 " (%s)", header->TimeDateStamp, timestr);
Expand Down

0 comments on commit 2576ebb

Please sign in to comment.