aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPali Rohár <pali.rohar@gmail.com>2020-02-19 22:39:29 +0100
committerPali Rohár <pali.rohar@gmail.com>2020-02-19 22:39:29 +0100
commit70c5c20a7c4b23720fbba8be4508a002a0f7c28a (patch)
tree6a67104ff1a9e7bb4912f70b81694f8e62bda10f
parent974b39c7a481e2b2cf767090ebd6c104ad16c4b3 (diff)
downloaddlfcn-win32-70c5c20a7c4b23720fbba8be4508a002a0f7c28a.tar.gz
dlfcn-win32-70c5c20a7c4b23720fbba8be4508a002a0f7c28a.tar.bz2
dlfcn-win32-70c5c20a7c4b23720fbba8be4508a002a0f7c28a.zip
Show "(null)" in error message when passed filname to dlopen() was NULL and error occurred
It does not make sense to pass file variable (which is NULL) to function save_err_ptr_str() which converts its argument to string. We can call directly save_err_str() with string value. Also it is highly unexpected that GetModuleHandle(NULL) call fails.
-rw-r--r--dlfcn.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/dlfcn.c b/dlfcn.c
index e13c631..2497a39 100644
--- a/dlfcn.c
+++ b/dlfcn.c
@@ -233,7 +233,7 @@ void *dlopen( const char *file, int mode )
233 hModule = GetModuleHandle( NULL ); 233 hModule = GetModuleHandle( NULL );
234 234
235 if( !hModule ) 235 if( !hModule )
236 save_err_ptr_str( file ); 236 save_err_str( "(null)" );
237 } 237 }
238 else 238 else
239 { 239 {