Logo AND Algorithmique Numérique Distribuée

Public GIT Repository
Improve compilation time by epsilon by sharpening the includes (str.h loads dynar...
[simgrid.git] / src / xbt / xbt_str.c
index 6167b1f..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); \
@@ -454,7 +457,7 @@ char *xbt_str_join(xbt_dynar_t dyn, const char*sep) {
   res = xbt_malloc(len);
   p=res;
   xbt_dynar_foreach(dyn,cpt,cursor) {
-    if (cpt<dyn_len-1)
+    if ((int)cpt<dyn_len-1)
       p+=sprintf(p,"%s%s",cursor,sep);    
     else
       p+=sprintf(p,"%s",cursor);