Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
[trace] use xbt_strdup to copy category
authorschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 09:56:31 +0000 (09:56 +0000)
committerschnorr <schnorr@48e7efb5-ca39-0410-a469-dd3cf9ba447f>
Tue, 7 Dec 2010 09:56:31 +0000 (09:56 +0000)
git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@9044 48e7efb5-ca39-0410-a469-dd3cf9ba447f

src/instr/instr_simdag.c
src/instr/instr_surf.c

index 96b5bfe..dc7c556 100644 (file)
@@ -24,8 +24,7 @@ void TRACE_sd_set_task_category(SD_task_t task, const char *category)
 {
   if (!TRACE_is_active())
     return;
 {
   if (!TRACE_is_active())
     return;
-  task->category = xbt_new(char, strlen(category) + 1);
-  strcpy(task->category, category);
+  task->category = xbt_strdup (category);
 }
 
 #endif /* HAVE_TRACING */
 }
 
 #endif /* HAVE_TRACING */
index e2c2d93..bfec1b8 100644 (file)
@@ -270,7 +270,6 @@ void TRACE_surf_action(surf_action_t surf_action, const char *category)
   if (!category)
     return;
 
   if (!category)
     return;
 
-  surf_action->category = xbt_new(char, strlen(category) + 1);
-  strncpy(surf_action->category, category, strlen(category) + 1);
+  surf_action->category = xbt_strdup(category);
 }
 #endif /* HAVE_TRACING */
 }
 #endif /* HAVE_TRACING */