From 3edf444ca1a00d6b37f3c4ea221f9f74f0b20c33 Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Sat, 2 Sep 2000 19:29:32 +0000 Subject: bugfix git-svn-id: http://svn.irssi.org/repos/irssi/trunk@642 dbcabf3a-b0e7-0310-adc4-f8d773084564 --- src/core/modules.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'src/core/modules.c') 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' */ -- cgit v1.2.3