Skip to content

Commit 21d6519

Browse files
committed
xrCore: replace Module load file postfix on std:string
1 parent 98372be commit 21d6519

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

src/xrCore/ModuleLookup.cpp

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,17 +29,15 @@ void* ModuleHandle::Open(pcstr moduleName)
2929
#ifdef WINDOWS
3030
handle = LoadLibraryA(moduleName);
3131
#elif defined(LINUX)
32-
char buf[1024];
33-
snprintf(buf, sizeof(buf), "%s.so", moduleName);
34-
35-
handle = dlopen(buf, RTLD_LAZY);
32+
std::string soName = std::string(moduleName) + ".so";
33+
handle = dlopen(soName.c_str(), RTLD_LAZY);
3634
#endif
3735
if (handle == nullptr)
3836
{
3937
#ifdef WINDOWS
4038
Msg("! Failed to load DLL: 0x%d", GetLastError());
4139
#elif defined(LINUX)
42-
Msg("! Failed to load DLL: %s", dlerror());
40+
Msg("! Failed to load DLL %s: %s", soName.c_str(), dlerror());
4341
#endif
4442
}
4543

0 commit comments

Comments
 (0)