Skip to content

Commit

Permalink
addrline: Use stdint.h macros for 64bit integers
Browse files Browse the repository at this point in the history
  • Loading branch information
jrfonseca committed Nov 22, 2017
1 parent b118754 commit 16aa49d
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/addr2line/addr2line.cpp
Expand Up @@ -22,9 +22,12 @@
*/


#define __STDC_FORMAT_MACROS 1

#include <assert.h>
#include <stdio.h>
#include <stdint.h>
#include <inttypes.h>

#include <windows.h>
#include <dbghelp.h>
Expand Down Expand Up @@ -112,11 +115,11 @@ main(int argc, char **argv)
const char *arg = argv[i];
DWORD64 dwRelAddr;
if (arg[0] == '0' && arg[1] == 'x') {
sscanf(&arg[2], "%08I64X", &dwRelAddr);
sscanf(&arg[2], "%08" PRIX64, &dwRelAddr);
} else {
dwRelAddr = atol(arg);
}
printf("dwRelAddr = %08I64X\n", dwRelAddr);
printf("dwRelAddr = %08" PRIX64 "\n", dwRelAddr);

UINT_PTR dwAddr = (UINT_PTR)hModule + dwRelAddr;

Expand Down

0 comments on commit 16aa49d

Please sign in to comment.