/* This program is free software; you can redistribute it and/or modify it
* under the terms of the license (GNU LGPL) which comes with this package. */
+#include "src/internal_config.h"
#include "src/simdag/simdag_private.h"
#include "simgrid/simdag.h"
#include "xbt/file.h"
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(sd_dotparse, sd, "Parsing DOT files");
-#ifdef HAVE_GRAPHVIZ
+#if HAVE_GRAPHVIZ
#include <graphviz/cgraph.h>
#endif
dst = (SD_task_t)xbt_dict_get_or_null(jobs, dst_name);
if (size > 0) {
- char *name = (char*)xbt_malloc((strlen(src_name)+strlen(dst_name)+6)*sizeof(char));
- sprintf(name, "%s->%s", src_name, dst_name);
+ int namesize=(strlen(src_name)+strlen(dst_name)+6);
+ char *name = (char*)xbt_malloc(namesize*sizeof(char*));
+ snprintf(name,namesize, "%s->%s", src_name, dst_name);
XBT_DEBUG("See <transfer id=%s amount = %.0f>", name, size);
if (!(task = (SD_task_t)xbt_dict_get_or_null(jobs, name))) {
if (seq_or_par == sequential)
}
if (result && !acyclic_graph_detail(result)) {
- XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.", xbt_basename((char*)filename));
+ char* base = xbt_basename(filename);
+ XBT_ERROR("The DOT described in %s is not a DAG. It contains a cycle.", base);
+ free(base);
xbt_dynar_free(&result);
result = NULL;
}