Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Merge branch 'coverity_scan' of github.com:mquinson/simgrid
[simgrid.git] / src / simgrid / host.cpp
index 08c5d4f..cbe140a 100644 (file)
@@ -29,7 +29,7 @@ size_t sg_host_count()
  * internally).
  * \see sg_host_count()
  */
-const sg_host_t *sg_host_list(void) {
+sg_host_t *sg_host_list(void) {
   xbt_assert(sg_host_count() > 0, "There is no host!");
   return (sg_host_t*)xbt_dynar_to_array(sg_hosts_as_dynar());
 }
@@ -67,7 +67,7 @@ xbt_dynar_t sg_hosts_as_dynar(void)
   const char* name = nullptr;
   simgrid::s4u::Host* host = nullptr;
   xbt_dict_foreach(host_list, cursor, name, host)
-    if(routing_get_network_element_type(name) == SURF_NETWORK_ELEMENT_HOST)
+    if (host && host->pimpl_netcard && host->pimpl_netcard->getRcType() == SURF_NETWORK_ELEMENT_HOST)
        xbt_dynar_push(res, &host);
   return res;
 }