X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1d313eeb54204a0641ba0a750f4b90a7a63bcee2..82d505137c461555ee2da685a1ec7938425e8380:/src/xbt/config.c diff --git a/src/xbt/config.c b/src/xbt/config.c index 835fd0eff9..0c00bcd7df 100644 --- a/src/xbt/config.c +++ b/src/xbt/config.c @@ -412,9 +412,16 @@ void xbt_cfg_help(xbt_cfg_t cfg) printf("'%s'%s", xbt_dynar_get_as(variable->content, i, char *), sep); break; - case xbt_cfgelm_boolean: - printf("'%d'%s", xbt_dynar_get_as(variable->content, i, int), sep); + case xbt_cfgelm_boolean: { + int b = xbt_dynar_get_as(variable->content, i, int); + const char *bs = b ? xbt_cfgelm_boolean_values[0].true_val + : xbt_cfgelm_boolean_values[0].false_val; + if (b == 0 || b == 1) + printf("'%s'%s", bs, sep); + else + printf("'%s/%d'%s", bs, b, sep); break; + } case xbt_cfgelm_peer: { xbt_peer_t hval = xbt_dynar_get_as(variable->content, i, xbt_peer_t); @@ -657,7 +664,7 @@ void xbt_cfg_set_parse(xbt_cfg_t cfg, const char *options) { val = strchr(name, ':'); if (!val) { - free(optionlist_cpy); + /* don't free(optionlist_cpy) here, 'name' points inside it */ xbt_die("Option '%s' badly formated. Should be of the form 'name:value'", name); }