diff options
author | Timo Sirainen <cras@irssi.org> | 2000-09-02 19:29:32 +0000 |
---|---|---|
committer | cras <cras@dbcabf3a-b0e7-0310-adc4-f8d773084564> | 2000-09-02 19:29:32 +0000 |
commit | 3edf444ca1a00d6b37f3c4ea221f9f74f0b20c33 (patch) | |
tree | ee8ff23c5b0c025011797dc110f2f2e02fb0d867 /src | |
parent | 755a8d40eb5f9e0a12b98e4f84332891a3d63b1a (diff) | |
download | irssi-3edf444ca1a00d6b37f3c4ea221f9f74f0b20c33.zip |
bugfix
git-svn-id: http://svn.irssi.org/repos/irssi/trunk@642 dbcabf3a-b0e7-0310-adc4-f8d773084564
Diffstat (limited to 'src')
-rw-r--r-- | src/core/modules.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/src/core/modules.c b/src/core/modules.c index 7b81bff2..2c3acbd7 100644 --- a/src/core/modules.c +++ b/src/core/modules.c @@ -37,9 +37,14 @@ void *module_check_cast(void *object, int type_pos, const char *id) void *module_check_cast_module(void *object, int type_pos, const char *module, const char *id) { - return object == NULL || strcmp(module_find_id_str(module, - G_STRUCT_MEMBER(int, object, type_pos)), id) == 0 ? - NULL : object; + const char *str; + + if (object == NULL) + return NULL; + + str = module_find_id_str(module, + G_STRUCT_MEMBER(int, object, type_pos)); + return str == NULL || strcmp(str, id) != 0 ? NULL : object; } /* return unique number across all modules for `id' */ |