route->links_id = xbt_dynar_new(sizeof(char *), &xbt_free_ref);
- char *tmp_links = malloc(sizeof(char)*strlen(links)+1);//use xbt
- strcpy(tmp_links,links);
+ char *tmp_links = xbt_strdup(links);
link_id = strtok(tmp_links,","); //tmp_link = strtok((char*)links,",");
while(link_id != NULL)
{
double end_time, const char *type) {
*event = (jed_event_t) calloc(1, sizeof(s_jed_event_t));
- (*event)->name = (char*) calloc(strlen(name) + 1, sizeof(char));
- strcpy((*event)->name, name);
+ (*event)->name = xbt_strdup(name);
(*event)->start_time = start_time;
(*event)->end_time = end_time;
- (*event)->type = (char*) calloc(strlen(type) + 1, sizeof(char));
- strcpy((*event)->type, type);
+ (*event)->type = xbt_strdup(type);
(*event)->resource_subsets = xbt_dynar_new(sizeof(jed_res_subset_t), NULL);
(*event)->characteristics_list = xbt_dynar_new(sizeof(char*), NULL);
xbt_assert( name != NULL );
*container = (jed_simgrid_container_t)calloc(1,sizeof(s_jed_simgrid_container_t));
- (*container)->name = (char*)calloc((strlen(name)+1), sizeof(char));
- strcpy((*container)->name, name);
+ (*container)->name = xbt_strdup(name);
(*container)->is_lowest = 0;
(*container)->container_children = xbt_dynar_new(sizeof(jed_simgrid_container_t), NULL);
(*container)->parent = NULL;
/* LARGE PLATFORMS HACK:
expand also with src->link and dst->link */
#ifdef HAVE_TRACING
- action->src_name = xbt_new(char, strlen(src_name) + 1);
- strncpy(action->src_name, src_name, strlen(src_name) + 1);
+ action->src_name = xbt_strdup(src_name);
- action->dst_name = xbt_new(char, strlen(dst_name) + 1);
- strncpy(action->dst_name, dst_name, strlen(dst_name) + 1);
+ action->dst_name = xbt_strdup(dst_name);
#endif
xbt_dynar_free(&route);
/* LARGE PLATFORMS HACK:
expand also with src->link and dst->link */
#ifdef HAVE_TRACING
- action->src_name = xbt_new(char, strlen(src_name) + 1);
- strncpy(action->src_name, src_name, strlen(src_name) + 1);
+ action->src_name = xbt_strdup(src_name);
- action->dst_name = xbt_new(char, strlen(dst_name) + 1);
- strncpy(action->dst_name, dst_name, strlen(dst_name) + 1);
+ action->dst_name = xbt_strdup(dst_name);
#endif
xbt_dynar_free(&route);
GetCurrentDirectory(MAX_PATH, buffer);
- borland_project.src_dir = xbt_new0(char, strlen(buffer) + 1);
-
- strcpy(borland_project.src_dir, buffer);
+ borland_project.src_dir = xbt_strdup(buffer);
borland_project.name =
xbt_new0(char, strlen(name) + strlen("simulator") + 2);
GetCurrentDirectory(MAX_PATH, buffer);
- borland_project.src_dir = xbt_new0(char, strlen(buffer) + 1);
-
- strcpy(borland_project.src_dir, buffer);
+ borland_project.src_dir = xbt_strdup(buffer);
borland_project.bin_dir =
xbt_new0(char, strlen(buffer) + strlen("\\bin") + 1);
GetEnvironmentVariable("LIB_SIMGRID_PATH", dsp.lib_dir, MAX_PATH);
GetCurrentDirectory(MAX_PATH, buffer);
- dsp.src_dir = xbt_new0(char, strlen(buffer) + 1);
- strcpy(dsp.src_dir, buffer);
+ dsp.src_dir = xbt_strdup(buffer);
dsp.name = xbt_new0(char, strlen(name) + strlen("simulator") + 2);
sprintf(dsp.name, "%s_simulator", name);
GetCurrentDirectory(MAX_PATH, buffer);
- dsp.src_dir = xbt_new0(char, strlen(buffer) + 1);
-
- strcpy(dsp.src_dir, buffer);
+ dsp.src_dir = xbt_strdup(buffer);
xbt_dict_foreach(process_function_set, cursor, key, data) {