X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/804984d2554e37c85236d342355a266945c4fd9a..66c35960bb3e0a056156f22f7defeaf8c08a74f4:/examples/msg/dht-kademlia/dht-kademlia.c diff --git a/examples/msg/dht-kademlia/dht-kademlia.c b/examples/msg/dht-kademlia/dht-kademlia.c index 1177377716..1b0dc4460f 100644 --- a/examples/msg/dht-kademlia/dht-kademlia.c +++ b/examples/msg/dht-kademlia/dht-kademlia.c @@ -15,8 +15,6 @@ */ XBT_LOG_NEW_DEFAULT_CATEGORY(msg_kademlia, "Messages specific for this msg example"); -extern long unsigned int smx_total_comms; - /* Main loop for the process */ static void main_loop(node_t node, double deadline) { @@ -276,8 +274,8 @@ unsigned int find_node(node_t node, unsigned int id_to_find, unsigned int count_ */ unsigned int ping(node_t node, unsigned int id_to_ping) { - char mailbox[MAILBOX_NAME_SIZE + 1]; - sprintf(mailbox, "%0*x", MAILBOX_NAME_SIZE, id_to_ping); + char mailbox[MAILBOX_NAME_SIZE]; + snprintf(mailbox,MAILBOX_NAME_SIZE, "%d", id_to_ping); unsigned int destination_found = 0; double timeout = MSG_get_clock() + ping_timeout; @@ -344,7 +342,7 @@ void random_lookup(node_t node) */ void send_find_node(node_t node, unsigned int id, unsigned int destination) { - char mailbox[MAILBOX_NAME_SIZE + 1]; + char mailbox[MAILBOX_NAME_SIZE]; /* Gets the mailbox to send to */ get_node_mailbox(id, mailbox); /* Build the task */ @@ -441,7 +439,6 @@ int main(int argc, char *argv[]) msg_error_t res = MSG_main(); - XBT_CRITICAL("Messages created: %ld", smx_total_comms); XBT_INFO("Simulated time: %g", MSG_get_clock()); return res != MSG_OK;