From: mquinson Date: Tue, 27 Nov 2007 16:08:34 +0000 (+0000) Subject: Dupplicate the string we put into the returned dynar, so that user can free it withou... X-Git-Tag: v3.3~775 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/a3fa1d952e6a7aa7c04de36149dfd452b5498683?hp=cc2b94d892a06fa78b8bc872a47130211d99f6c4 Dupplicate the string we put into the returned dynar, so that user can free it without issue git-svn-id: svn+ssh://scm.gforge.inria.fr/svn/simgrid/simgrid/trunk@5072 48e7efb5-ca39-0410-a469-dd3cf9ba447f --- diff --git a/src/xbt/xbt_str.c b/src/xbt/xbt_str.c index edd062b38f..805adab4be 100644 --- a/src/xbt/xbt_str.c +++ b/src/xbt/xbt_str.c @@ -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; } diff --git a/src/xbt_str_unit.c b/src/xbt_str_unit.c index 579d4b9d1a..ecf9026d11 100644 --- a/src/xbt_str_unit.c +++ b/src/xbt_str_unit.c @@ -8,7 +8,7 @@ /* GENERATED FILE, DO NOT EDIT */ /*******************************/ -# 386 "xbt/xbt_str.c" +# 387 "xbt/xbt_str.c" #define mytest(name, input, expected) \ xbt_test_add0(name); \ d=xbt_str_split_quoted(input); \