From 13dc60b5feb8778432f44b21022857b241e524fa Mon Sep 17 00:00:00 2001 From: Frederic Suter Date: Fri, 11 Aug 2017 14:25:37 +0200 Subject: [PATCH] try to fix ns3 build --- src/surf/network_ns3.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/surf/network_ns3.cpp b/src/surf/network_ns3.cpp index a3f621f6a9..34631b53a2 100644 --- a/src/surf/network_ns3.cpp +++ b/src/surf/network_ns3.cpp @@ -62,19 +62,18 @@ static void clusterCreation_cb(ClusterCreationArgs* cluster) NetPointNs3* host_dst = new NetPointNs3(); // Create private link - char* host_id = bprintf("%s%d%s", cluster->prefix, i, cluster->suffix); - NetPointNs3* host_src = sg_host_by_name(host_id)->pimpl_netpoint->extension(); - xbt_assert(host_src, "Cannot find a NS3 host of name %s", host_id); + std::string host_id = cluster->prefix + std::to_string(i) + cluster->suffix; + NetPointNs3* host_src = sg_host_by_name(host_id.c_str())->pimpl_netpoint->extension(); + xbt_assert(host_src, "Cannot find a NS3 host of name %s", host_id.c_str()); // Any NS3 route is symmetrical ns3_add_link(host_src, host_dst, cluster->bw, cluster->lat); delete host_dst; - free(host_id); } //Create link backbone - ns3_add_cluster(cluster->id, cluster->bb_bw, cluster->bb_lat); + ns3_add_cluster(cluster->id.c_str(), cluster->bb_bw, cluster->bb_lat); } static void routeCreation_cb(bool symmetrical, simgrid::kernel::routing::NetPoint* src, -- 2.20.1