forked from 0ad/0ad
Fix triggering of "buffer too small" error during some stack dumps.
Remove dlopen's debug_assert, for POSIX compatibility and because it causes very ugly problems when dumping the stack if the Collada DLL is missing. This was SVN commit r7530.
This commit is contained in:
parent
549ff09c8b
commit
ba7d237d9a
@ -95,6 +95,7 @@ class TestWdbgSym : public CxxTest::TestSuite
|
||||
|
||||
int ints[] = { 1,2,3,4,5 }; UNUSED2(ints);
|
||||
wchar_t chars[] = { 'w','c','h','a','r','s',0 }; UNUSED2(chars);
|
||||
wchar_t many_wchars[1024]; memset(many_wchars, 'a', sizeof(many_wchars));
|
||||
|
||||
debug_printf(L"\n(dumping stack frames may result in access violations..)\n");
|
||||
|
||||
|
@ -695,7 +695,10 @@ static LibError dump_string(const u8* p, size_t el_size)
|
||||
|
||||
wchar_t buf[512];
|
||||
if(el_size == sizeof(wchar_t))
|
||||
wcscpy_s(buf, ARRAY_SIZE(buf), (const wchar_t*)p);
|
||||
{
|
||||
wcsncpy(buf, (const wchar_t*)p, ARRAY_SIZE(buf)); // can't use wcscpy_s because p might be too long
|
||||
wcscpy_s(buf+ARRAY_SIZE(buf)-4, 4, L"..."); // ensure null-termination
|
||||
}
|
||||
// convert to wchar_t
|
||||
else
|
||||
{
|
||||
|
@ -57,7 +57,6 @@ void* dlopen(const char* so_name, int flags)
|
||||
|
||||
fs::path pathname = fs::change_extension(so_name, ".dll");
|
||||
HMODULE hModule = LoadLibraryA(pathname.string().c_str());
|
||||
debug_assert(hModule);
|
||||
return void_from_HMODULE(hModule);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user