Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Fix a god damn race condition: make sure nobody changes the dynar->used value before...
[simgrid.git] / src / xbt / xbt_str.c
index edd062b..6e4739b 100644 (file)
@@ -249,6 +249,7 @@ xbt_dynar_t xbt_str_split_str(const char *s, const char *sep) {
   if (s[0] == '\0') 
     return res;
   if (sep[0] == '\0') {
+    s = xbt_strdup(s);
     xbt_dynar_push(res, &s);
     return res;
   }
@@ -382,6 +383,8 @@ xbt_dynar_t xbt_str_split_quoted(const char *s) {
 }
 
 #ifdef SIMGRID_TEST
+#include "xbt/str.h"
+
 #define mytest(name, input, expected) \
   xbt_test_add0(name); \
   d=xbt_str_split_quoted(input); \