From 05a318f9e79ee4c7281d21a399cc513d0bf17a68 Mon Sep 17 00:00:00 2001 From: Dmitry-Me Date: Thu, 23 Jul 2015 16:35:47 +0300 Subject: [PATCH] Resolve CID 1312126 and maybe also CID 1288510 --- cli/cppcheckexecutor.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/cli/cppcheckexecutor.cpp b/cli/cppcheckexecutor.cpp index cd9265c00..9cf698530 100644 --- a/cli/cppcheckexecutor.cpp +++ b/cli/cppcheckexecutor.cpp @@ -580,22 +580,22 @@ static void PrintCallstack(FILE* f, PEXCEPTION_POINTERS ex) static void writeMemoryErrorDetails(FILE* f, PEXCEPTION_POINTERS ex, const char* description) { fputs(description, f); - fprintf(f, " (instruction: 0x%X) ", ex->ExceptionRecord->ExceptionAddress); + fprintf(f, " (instruction: 0x%p) ", ex->ExceptionRecord->ExceptionAddress); // Using %p for ULONG_PTR later on, so it must have size identical to size of pointer // This is not the universally portable solution but good enough for Win32/64 C_ASSERT(sizeof(void*) == sizeof(ex->ExceptionRecord->ExceptionInformation[1])); switch (ex->ExceptionRecord->ExceptionInformation[0]) { case 0: - fprintf(f, "reading from 0x%X", - ex->ExceptionRecord->ExceptionInformation[1]); + fprintf(f, "reading from 0x%p", + reinterpret_cast(ex->ExceptionRecord->ExceptionInformation[1])); break; case 1: - fprintf(f, "writing to 0x%X", - ex->ExceptionRecord->ExceptionInformation[1]); + fprintf(f, "writing to 0x%p", + reinterpret_cast(ex->ExceptionRecord->ExceptionInformation[1])); break; case 8: - fprintf(f, "data execution prevention at 0x%X", - ex->ExceptionRecord->ExceptionInformation[1]); + fprintf(f, "data execution prevention at 0x%p", + reinterpret_cast(ex->ExceptionRecord->ExceptionInformation[1])); break; default: break;