X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/85c342932c60954a7e1c9430742bfff2b28c31a8..6f9d72501fa9d57a34e2d5309adb5d6947182eea:/src/xbt/xbt_strbuff.c?ds=sidebyside diff --git a/src/xbt/xbt_strbuff.c b/src/xbt/xbt_strbuff.c index 16835fd961..1db44325f6 100644 --- a/src/xbt/xbt_strbuff.c +++ b/src/xbt/xbt_strbuff.c @@ -40,12 +40,12 @@ xbt_strbuff_t xbt_strbuff_new(void) /** @brief creates a new string buffer containing the provided string * - * Beware, we store the ctn directly, not a copy of it + * Beware, the ctn is copied, you want to free it afterward, anyhow */ -XBT_INLINE xbt_strbuff_t xbt_strbuff_new_from(char *ctn) +XBT_INLINE xbt_strbuff_t xbt_strbuff_new_from(const char *ctn) { xbt_strbuff_t res = malloc(sizeof(s_xbt_strbuff_t)); - res->data = ctn; + res->data = xbt_strdup(ctn); res->used = res->size = strlen(ctn); return res; }