From: cristianrosa Date: Tue, 28 Sep 2010 13:49:44 +0000 (+0000) Subject: Fix a 3 years old bug in the dictionary's function xbt_dict_get_or_null(). X-Git-Tag: v3_5~536 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a57b407195c6c671bb4dd2938344921d1c9a3778?hp=f00304f35fc10b4c8d3cdb6c2d910131c4169ef9 Fix a 3 years old bug in the dictionary's function xbt_dict_get_or_null(). It was broken when the hash_code of two elements collisioned. git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@8288 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/dict.c b/src/xbt/dict.c index b9079c652b..708cffbc2f 100644 --- a/src/xbt/dict.c +++ b/src/xbt/dict.c @@ -411,7 +411,7 @@ XBT_INLINE void *xbt_dict_get_or_null(xbt_dict_t dict, const char *key) current = dict->table[hash_code & dict->table_size]; while (current != NULL && - hash_code != current->hash_code && strcmp(key, current->key)) + (hash_code != current->hash_code || strcmp(key, current->key))) current = current->next; if (current == NULL)