Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
correct duplication of a variable
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 20 May 2010 11:15:04 +0000 (11:15 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Thu, 20 May 2010 11:15:04 +0000 (11:15 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@7778 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/instr/msg_process_instr.c
src/instr/smx_instr.c

index 86875a4..54f3bf6 100644 (file)
@@ -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);
index cd69d8e..848eb6f 100644 (file)
@@ -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);
   }
 }