Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Return SURF_NETWORK_ELEMENT_NULL if the elements is not found.
authornavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 9 Mar 2011 16:41:25 +0000 (16:41 +0000)
committernavarrop <navarrop@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Wed, 9 Mar 2011 16:41:25 +0000 (16:41 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9772 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/surf/surf_routing.c

index 42a3b98..c94cd5c 100644 (file)
@@ -1072,7 +1072,8 @@ static e_surf_network_element_type_t get_network_element_type(const char
                                                               *name)
 {
   network_element_info_t rc = NULL;
-  rc = xbt_dict_get(global_routing->where_network_elements, name);
+  rc = xbt_dict_get_or_null(global_routing->where_network_elements, name);
+  if(!rc) return SURF_NETWORK_ELEMENT_NULL;
   return rc->rc_type;
 }