From 130f7905bac69cf7cbad6c96a93aeaaea3737106 Mon Sep 17 00:00:00 2001 From: Nekotekina Date: Wed, 10 Aug 2016 14:17:07 +0300 Subject: [PATCH] Error report fix --- Utilities/Thread.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Utilities/Thread.cpp b/Utilities/Thread.cpp index 71f8946bc8..b48ef55715 100644 --- a/Utilities/Thread.cpp +++ b/Utilities/Thread.cpp @@ -1685,7 +1685,7 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) } std::vector modules; - for (DWORD size = 256; modules.size() < size; size /= sizeof(HMODULE)) + for (DWORD size = 256; modules.size() != size; size /= sizeof(HMODULE)) { modules.resize(size); if (!EnumProcessModules(GetCurrentProcess(), modules.data(), size * sizeof(HMODULE), &size)) @@ -1718,13 +1718,13 @@ static LONG exception_filter(PEXCEPTION_POINTERS pExp) if (pExp->ContextRecord->Rip >= base && pExp->ContextRecord->Rip < base + info.SizeOfImage) { std::string module_name; - for (DWORD size = 256; module_name.size() < size;) + for (DWORD size = 15; module_name.size() != size;) { module_name.resize(size); - size = GetModuleBaseNameA(GetCurrentProcess(), module, &module_name.front(), size); + size = GetModuleBaseNameA(GetCurrentProcess(), module, &module_name.front(), size + 1); if (!size) { - module_name.resize(1, '\0'); + module_name.clear(); break; } }