Skip to content

Commit

Permalink
avoid NULL in fribidi shim
Browse files Browse the repository at this point in the history
  • Loading branch information
nulano committed Nov 25, 2020
1 parent 1d2ee89 commit 9bd9049
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions src/thirdparty/fribidi-shim/fribidi.c
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
int load_fribidi(void) {
int error = 0;

p_fribidi = NULL;
p_fribidi = 0;

/* Microsoft needs a totally different system */
#ifndef _WIN32
Expand All @@ -36,11 +36,11 @@ int load_fribidi(void) {
#ifndef _WIN32
#define LOAD_FUNCTION(func) \
func = (t_##func)dlsym(p_fribidi, #func); \
error = error || (func == NULL);
error = error || (func == 0);
#else
#define LOAD_FUNCTION(func) \
func = (t_##func)GetProcAddress(p_fribidi, #func); \
error = error || (func == NULL);
error = error || (func == 0);
#endif

LOAD_FUNCTION(fribidi_get_bidi_types);
Expand All @@ -52,16 +52,16 @@ int load_fribidi(void) {

#ifndef _WIN32
fribidi_version_info = *(const char**)dlsym(p_fribidi, "fribidi_version_info");
if (dlerror() || error || (fribidi_version_info == NULL)) {
if (dlerror() || error || (fribidi_version_info == 0)) {
dlclose(p_fribidi);
p_fribidi = NULL;
p_fribidi = 0;
return 2;
}
#else
fribidi_version_info = *(const char**)GetProcAddress(p_fribidi, "fribidi_version_info");
if (error || (fribidi_version_info == NULL)) {
if (error || (fribidi_version_info == 0)) {
FreeLibrary(p_fribidi);
p_fribidi = NULL;
p_fribidi = 0;
return 2;
}
#endif
Expand Down

0 comments on commit 9bd9049

Please sign in to comment.