From 274b89cec9108649450196553ea0486f067824ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jean-Pierre=20Andr=C3=A9?= Date: Fri, 17 Apr 2015 09:03:08 +0200 Subject: [PATCH] Avoided truncation in a debug message in secaudit When compiled for Windows 64-bit, pointers have to be displayed as "long long" instead of "long" which is 32-bit --- src/secaudit.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/secaudit.c b/src/secaudit.c index 8ffb2a91..c5aa7e3a 100644 --- a/src/secaudit.c +++ b/src/secaudit.c @@ -7272,9 +7272,15 @@ void dumpalloc(const char *txt) if (firstalloc) { printf("alloc table at %s\n",txt); for (q=firstalloc; q; q=q->next) +#ifdef __x86_64__ + printf("%08llx : %u bytes at %08llx allocated at %s line %d\n", + (long long)q,(unsigned int)q->size, + (long long)q->alloc,q->file,q->line); +#else printf("%08lx : %u bytes at %08lx allocated at %s line %d\n", (long)q,(unsigned int)q->size, (long)q->alloc,q->file,q->line); +#endif } } @@ -7364,7 +7370,13 @@ BOOL chkisalloc(void *p, const char *file, int line) } else q = (struct CHKALLOC*)NULL; if (!p || !q) { - printf("error in %s %d : 0x%lx not allocated\n",file,line,(long)p); +#ifdef __x86_64__ + printf("error in %s %d : 0x%llx not allocated\n",file,line, + (long long)p); +#else + printf("error in %s %d : 0x%lx not allocated\n",file,line, + (long)p); +#endif } return (p && q); }