Skip to content

Commit 679fa33

Browse files
Explicitly convert function to function pointer during comparison
This fixes the following Coverity issue: `src/acl_support.cpp:403:34: Type: Function address comparison (BAD_COMPARE) src/acl_support.cpp:403:34: func_conv: This implicit conversion to a function pointer is suspicious: "dlopen != NULL". src/acl_support.cpp:403:34: remediation: Did you intend to call "dlopen"?`
1 parent d188f5c commit 679fa33

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/acl_support.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,7 @@ char *acl_dlerror(void) {
374374
}
375375
}
376376

377-
int acl_dlpresent(void) { return LoadLibrary != 0; }
377+
int acl_dlpresent(void) { return &LoadLibrary != nullptr; }
378378

379379
int acl_dlclose(void *handle) { return (int)FreeLibrary((HMODULE)handle); }
380380

@@ -400,7 +400,7 @@ void *acl_dlsym(void *dllhandle, const char *symbolname) {
400400

401401
char *acl_dlerror(void) { return dlerror(); }
402402

403-
int acl_dlpresent(void) { return dlopen != 0; }
403+
int acl_dlpresent(void) { return &dlopen != nullptr; }
404404

405405
int acl_dlclose(void *dllhandle) { return !dlclose(dllhandle); }
406406

0 commit comments

Comments
 (0)