From: schnorr Date: Thu, 20 May 2010 11:15:04 +0000 (+0000) Subject: correct duplication of a variable X-Git-Tag: v3_5~1030 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/01ea0133fc146d94852753a7f07d874de0b9815c correct duplication of a variable git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7778 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/instr/msg_process_instr.c b/src/instr/msg_process_instr.c index 86875a41b7..54f3bf6dd9 100644 --- a/src/instr/msg_process_instr.c +++ b/src/instr/msg_process_instr.c @@ -51,8 +51,7 @@ void TRACE_msg_set_process_category (m_process_t process, const char *category) if (!IS_TRACING) return; //set process category - process->category = xbt_new (char, strlen (category)+1); - strncpy (process->category, category, strlen(category)+1); + process->category = xbt_strdup(category); //create container of type "PROCESS" to indicate location __TRACE_msg_process_location (process); diff --git a/src/instr/smx_instr.c b/src/instr/smx_instr.c index cd69d8effb..848eb6fb4b 100644 --- a/src/instr/smx_instr.c +++ b/src/instr/smx_instr.c @@ -29,8 +29,7 @@ void TRACE_smx_action_communicate (smx_action_t act, smx_process_t proc) act->counter = counter++; char *category = __TRACE_current_category_get (proc); if (category){ - act->category = xbt_new (char, strlen (category)+1); - strncpy (act->category, category, strlen(category)+1); + act->category = xbt_strdup (category); } }