Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix a 3 years old bug in the dictionary's function xbt_dict_get_or_null().
[simgrid.git] / src / xbt / dict.c
index b9079c6..708cffb 100644 (file)
@@ -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)