X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/795baf05d5f795265283aeaa6e52f718b75e3792..4a9e1133c2a88d3d06f9a1d10a76cf0fbc049e8a:/src/xbt/xbt_str.c diff --git a/src/xbt/xbt_str.c b/src/xbt/xbt_str.c index dfe4f28d96..83deab85e5 100644 --- a/src/xbt/xbt_str.c +++ b/src/xbt/xbt_str.c @@ -350,6 +350,7 @@ XBT_TEST_UNIT("xbt_str_split_quoted",test_split_quoted, "test the function xbt_s xbt_dynar_t d; char *s; + mytest("Empty", "", ""); mytest("Basic test", "toto tutu", "totoXXXtutu"); mytest("Useless backslashes", "\\t\\o\\t\\o \\t\\u\\t\\u", "totoXXXtutu"); mytest("Protected space", "toto\\ tutu", "toto tutu"); @@ -372,6 +373,10 @@ char *xbt_str_join(xbt_dynar_t dyn, const char*sep) { int cpt; char *cursor; char *res,*p; + + if (!dyn_len) + return xbt_strdup(""); + /* compute the length */ xbt_dynar_foreach(dyn,cpt,cursor) { len+=strlen(cursor);