diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/library/loader.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/library/loader.c b/src/library/loader.c index aa501e3..96141e0 100644 --- a/src/library/loader.c +++ b/src/library/loader.c @@ -135,9 +135,19 @@ WOLF_LIBRARY_FUNCPTR wolf_library_get_func( const wolf_library_p l, const char * #if defined HAVE_DLFCN ret = dlsym( l->handle, name ); + if( ret == NULL ) { + strncpy( l->errbuf, dlerror( ), INTERNAL_ERRBUF_SIZE ); + return WOLF_ERR_INTERNAL; + } #else #if defined _WIN32 ret = GetProcAddress( l->handle, name ); + if( ret == NULL ) { + printf( "XXX: %d\n", GetLastError( ) ); + strncpy( l->errbuf, "<TODO: GetLastError>", INTERNAL_ERRBUF_SIZE ); + *error = WOLF_ERR_INTERNAL; + return ret; + } #else #error Not using DLFCN as shared loader. Port first! #endif |