strcmp(name+rootlen, "_core") == 0)
return g_strdup("core");
- if (namelen+1 > rootlen && name[namelen-rootlen-1] == '_' &&
+ if (namelen > rootlen && name[namelen-rootlen-1] == '_' &&
strcmp(name+namelen-rootlen, root) == 0)
return g_strndup(name, namelen-rootlen-1);
GModule *gmodule;
MODULE_REC *module;
MODULE_FILE_REC *rec;
+ gpointer value1, value2;
char *initfunc, *deinitfunc;
int found;
/* get the module's init() and deinit() functions */
initfunc = module_get_func(rootmodule, submodule, "init");
deinitfunc = module_get_func(rootmodule, submodule, "deinit");
- found = g_module_symbol(gmodule, initfunc, (gpointer *) &module_init) &&
- g_module_symbol(gmodule, deinitfunc, (gpointer *) &module_deinit);
+ found = g_module_symbol(gmodule, initfunc, &value1) &&
+ g_module_symbol(gmodule, deinitfunc, &value2);
g_free(initfunc);
g_free(deinitfunc);
+ module_init = value1;
+ module_deinit = value2;
+
if (!found) {
module_error(MODULE_ERROR_INVALID, NULL,
rootmodule, submodule);