diff options
| author | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-11-06 08:11:05 +0100 |
|---|---|---|
| committer | ManoloFLTK <41016272+ManoloFLTK@users.noreply.github.com> | 2022-11-06 08:11:05 +0100 |
| commit | 44219594d18e8c66624be8021fb436b130b14b26 (patch) | |
| tree | a0e24653765044ee915cb890cdb45b6c09989611 /src | |
| parent | 6ccd71697d3be8a3d7fce055c32d645eebfc30c1 (diff) | |
Check return value from call to gtk_init_check()
Diffstat (limited to 'src')
| -rw-r--r-- | src/drivers/Posix/Fl_Posix_System_Driver.cxx | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/drivers/Posix/Fl_Posix_System_Driver.cxx b/src/drivers/Posix/Fl_Posix_System_Driver.cxx index 63d5d6101..dcf9e8f1a 100644 --- a/src/drivers/Posix/Fl_Posix_System_Driver.cxx +++ b/src/drivers/Posix/Fl_Posix_System_Driver.cxx @@ -247,7 +247,7 @@ void *Fl_Posix_System_Driver::dlopen_or_dlsym(const char *lib_name, const char * void *Fl_Posix_System_Driver::ptr_gtk = NULL; bool Fl_Posix_System_Driver::probe_for_GTK(int major, int minor, void **p_ptr_gtk) { - typedef void (*init_t)(int*, void*); + typedef int (*init_t)(int*, char***); init_t init_f = NULL; // was GTK previously loaded? if (Fl_Posix_System_Driver::ptr_gtk) { // yes, it was. @@ -287,7 +287,10 @@ bool Fl_Posix_System_Driver::probe_for_GTK(int major, int minor, void **p_ptr_gt char *p = setlocale(LC_ALL, NULL); if (p) before = fl_strdup(p); int ac = 0; - init_f(&ac, NULL); // may change the locale + if ( !init_f(&ac, NULL) ) { // may change the locale + free(before); + return false; + } if (before) { setlocale(LC_ALL, before); // restore calling program's current locale free(before); |
