From: Arnaud Giersch Date: Tue, 10 May 2011 14:03:49 +0000 (+0200) Subject: Fix error message. X-Git-Tag: v3_6_rc3~57 X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/commitdiff_plain/5e61205077b453d1460c7008d1af3a68e6667db6?ds=sidebyside Fix error message. Subtraction (optionlist_cpy - name) was upside-down. Change to only keep the name of the variable. --- diff --git a/src/xbt/config.c b/src/xbt/config.c index 71f90259e3..0e532308ef 100644 --- a/src/xbt/config.c +++ b/src/xbt/config.c @@ -675,14 +675,14 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options) variable = xbt_dict_get((xbt_dict_t) cfg, name); } CATCH(e) { - /* put it back on what won't get freed, ie within "options" and out of "optionlist_cpy" */ - name = (char *) (optionlist_cpy - name + options); - free(optionlist_cpy); if (e.category == not_found_error) { xbt_ex_free(e); + name = xbt_strdup(name); + free(optionlist_cpy); THROWF(not_found_error, 0, "No registered variable corresponding to '%s'.", name); } + free(optionlist_cpy); RETHROW; }