X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/6760cb07d6b57be16928d95339d71e57c4e24f36..6cf3e5a62a7a4a685ddce69bac69d71fe0966a86:/src/xbt/xbt_peer.c diff --git a/src/xbt/xbt_peer.c b/src/xbt/xbt_peer.c index a4625888eb..919f51dd5a 100644 --- a/src/xbt/xbt_peer.c +++ b/src/xbt/xbt_peer.c @@ -21,6 +21,7 @@ xbt_peer_t xbt_peer_new(const char *name, int port) return res; } +/** \brief copy constructor */ xbt_peer_t xbt_peer_copy(xbt_peer_t h) { return xbt_peer_new(h->name, h->port); @@ -32,7 +33,7 @@ xbt_peer_t xbt_peer_from_string(const char *peerport) xbt_peer_t res = xbt_new(s_xbt_peer_t, 1); char *name = xbt_strdup(peerport); char *port_str = strchr(name, ':'); - xbt_assert1(port_str, + xbt_assert(port_str, "argument of xbt_peer_from_string should be of form :, it's '%s'", peerport); *port_str = '\0'; @@ -48,8 +49,7 @@ xbt_peer_t xbt_peer_from_string(const char *peerport) void xbt_peer_free(xbt_peer_t peer) { if (peer) { - if (peer->name) - free(peer->name); + free(peer->name); free(peer); } }