X-Git-Url: http://info.iut-bm.univ-fcomte.fr/pub/gitweb/simgrid.git/blobdiff_plain/1ecbb4c88462e9ec9be0c830a257da6e9b774a25..f25af1e2829458e33a3a0b74c75865c89dff5f9e:/src/surf/surf_routing.c diff --git a/src/surf/surf_routing.c b/src/surf/surf_routing.c index 3b6d3081b3..db11b969ce 100644 --- a/src/surf/surf_routing.c +++ b/src/surf/surf_routing.c @@ -2504,9 +2504,8 @@ static char *remplace(char *value, const char **src_list, int src_size, param_list = dst_list; param_size = dst_size; } else { - xbt_die(bprintf( - "bad string parameter, support only \"src\" and \"dst\", at offset: %d (\"%s\")", - i, value)); + xbt_die("bad string parameter, support only \"src\" and \"dst\", " + "at offset: %d (\"%s\")", i, value); } i = i + 3; @@ -2605,8 +2604,8 @@ static route_extended_t rulebased_get_route(routing_component_t rc, are_processing_units = 0; rule_list = routing->list_ASroute; } else - xbt_die(bprintf("Ask for route \"from\"(%s) or \"to\"(%s) no found in the local table", - src, dst)); + xbt_die("Ask for route \"from\"(%s) or \"to\"(%s) no found in " + "the local table", src, dst); int rc_src = -1; int rc_dst = -1; @@ -3873,6 +3872,7 @@ static void routing_parse_Srandom(void) double res = 0; int i = 0; random_data_t random = xbt_new0(s_random_data_t, 1); + char *tmpbuf; xbt_dynar_t radical_elements; unsigned int iter; @@ -3930,7 +3930,9 @@ static void routing_parse_Srandom(void) case 1: xbt_assert1(!xbt_dict_get_or_null(random_value,random_id),"Custom Random '%s' already exists !",random_id); res = random_generate(random); - xbt_dict_set(random_value, bprintf("%s%d",random_id,atoi(xbt_dynar_getfirst_as(radical_ends,char *))), bprintf("%f",res), free); + tmpbuf = bprintf("%s%d",random_id,atoi(xbt_dynar_getfirst_as(radical_ends,char *))); + xbt_dict_set(random_value, tmpbuf, bprintf("%f",res), free); + xbt_free(tmpbuf); break; case 2: surf_parse_get_int(&start, @@ -3939,7 +3941,9 @@ static void routing_parse_Srandom(void) for (i = start; i <= end; i++) { xbt_assert1(!xbt_dict_get_or_null(random_value,random_id),"Custom Random '%s' already exists !",bprintf("%s%d",random_id,i)); res = random_generate(random); - xbt_dict_set(random_value, bprintf("%s%d",random_id,i), bprintf("%f",res), free); + tmpbuf = bprintf("%s%d",random_id,i); + xbt_dict_set(random_value, tmpbuf, bprintf("%f",res), free); + xbt_free(tmpbuf); } break; default: