#include <omp.h>
#include <stdio.h>
#include <string.h>
+#include <errno.h>
static ompt_set_callback_t ompt_multiplex_set_callback;
static ompt_get_task_info_t ompt_multiplex_get_task_info;
const char *tool_libs = getenv(CLIENT_TOOL_LIBRARIES_VAR);
if (tool_libs) {
// copy environement variable
- char *tool_libs_buffer = (char *)malloc(sizeof(char) * strlen(tool_libs));
+ char *tool_libs_buffer = strdup(tool_libs);
if (!tool_libs_buffer) {
- printf("malloc Error\n");
+ printf("strdup Error (%i)\n", errno);
exit(-1);
}
- strcpy(tool_libs_buffer, tool_libs);
int progress = 0;
while (progress < strlen(tool_libs)) {