diff options
author | Pali Rohár <pali.rohar@gmail.com> | 2020-02-19 22:39:29 +0100 |
---|---|---|
committer | Pali Rohár <pali.rohar@gmail.com> | 2020-02-19 22:39:29 +0100 |
commit | 70c5c20a7c4b23720fbba8be4508a002a0f7c28a (patch) | |
tree | 6a67104ff1a9e7bb4912f70b81694f8e62bda10f | |
parent | 974b39c7a481e2b2cf767090ebd6c104ad16c4b3 (diff) | |
download | dlfcn-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.c | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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 | { |