#include "simgrid/jedule/jedule_output.h"
-#ifdef HAVE_JEDULE
+#if HAVE_JEDULE
+
+#define STR_BUF_SIZE 1024
XBT_LOG_NEW_DEFAULT_SUBCATEGORY(jed_out, jedule, "Logging specific to Jedule output");
}
static void get_hierarchy_string(jed_simgrid_container_t container, char *outbuf) {
- char buf[1024];
+ char buf[STR_BUF_SIZE];
xbt_dynar_t hier_list;
unsigned int iter;
int number;
xbt_dynar_foreach(hier_list, iter, number) {
if( iter != length-1 ) {
- sprintf(buf, "%d.", number);
+ snprintf(buf, STR_BUF_SIZE, "%d.", number);
} else {
- sprintf(buf, "%d", number);
+ snprintf(buf, STR_BUF_SIZE, "%d", number);
}
- strcat(outbuf, buf);
+ strncat(outbuf, buf, STR_BUF_SIZE-strlen(outbuf));
}
xbt_dynar_free(&hier_list);
unsigned int res_nb;
unsigned int i;
char *res_name;
- char resid[1024];
+ char resid[STR_BUF_SIZE];
xbt_assert( resource_parent->resource_list != NULL );
res_nb = xbt_dynar_length(resource_parent->resource_list);
xbt_dynar_foreach(event->resource_subsets, i, subset) {
int start = subset->start_idx;
int end = subset->start_idx + subset->nres - 1;
- char resid[1024];
+ char resid[STR_BUF_SIZE];
get_hierarchy_string(subset->parent, resid);
fprintf(jed_file, " <select resources=\"");