From 5d92a76d54f0104f9ed747a1c89363806e5d4ac4 Mon Sep 17 00:00:00 2001 From: mquinson Date: Wed, 28 Oct 2009 22:17:55 +0000 Subject: [PATCH] Try to fix #8852 (SimGrid won't compile on Ubuntu 9.10) by betterly checking my arguments to standard functions git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@6817 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- src/gras/Msg/gras_msg_exchange.c | 2 +- src/gras/Msg/rpc.c | 2 +- src/xbt/cunit.c | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gras/Msg/gras_msg_exchange.c b/src/gras/Msg/gras_msg_exchange.c index 79bd73cdfa..c4a233978c 100644 --- a/src/gras/Msg/gras_msg_exchange.c +++ b/src/gras/Msg/gras_msg_exchange.c @@ -86,7 +86,7 @@ gras_msg_wait_ext_(double timeout, restart_receive: /* Goto here when the receive of a message failed */ need_restart = 0; now = gras_os_time(); - memset(&msg, sizeof(msg), 0); + memset(&msg, 0, sizeof(msg)); TRY { xbt_queue_shift_timed(pd->msg_received, &msg, diff --git a/src/gras/Msg/rpc.c b/src/gras/Msg/rpc.c index 8f5943525b..86c5788736 100644 --- a/src/gras/Msg/rpc.c +++ b/src/gras/Msg/rpc.c @@ -112,7 +112,7 @@ void gras_msg_ctx_mallocator_free_f(void *ctx) void gras_msg_ctx_mallocator_reset_f(void *ctx) { - memset(ctx, sizeof(s_gras_msg_cb_ctx_t), 0); + memset(ctx, 0, sizeof(s_gras_msg_cb_ctx_t)); } /** @brief Launch a RPC call, but do not block for the answer */ diff --git a/src/xbt/cunit.c b/src/xbt/cunit.c index 15d6afa101..57a988c6e9 100644 --- a/src/xbt/cunit.c +++ b/src/xbt/cunit.c @@ -284,7 +284,7 @@ static int xbt_test_suite_run(xbt_test_suite_t suite) sprintf(suite_title + 40 - (suite_len + 4) / 2, "[ %s ]", suite->title); suite_title[40 + (suite_len + 5) / 2] = '='; if (!suite->enabled) - sprintf(suite_title + 70, " DISABLED "); + snprintf(suite_title + 70, 11, " DISABLED "); fprintf(stderr, "\n%s\n", suite_title); } -- 2.20.1