Change-Id: I43fa4fb6b4b333380eff51c6e7c68332a62a8b27
}
/* XXXXXX will be randomized by mkdtemp */
- char *tmp_dir_strdup = realpath(tmp_dir, NULL); /* Copy to avoid to have the same buffer as input and output for sprintf */
+
+ char *tmp_dir_strdup[PATH_MAX];
+ char *res = realpath(tmp_dir, tmp_dir_strdup);
+ if (!res)
+ {
+ fprintf(stderr, _("Warning: Could not resolve the realpath of %s.\n"), tmp_dir);
+ }
sprintf(tmp_dir, "%s/SCI_TMP_%d_XXXXXX", tmp_dir_strdup, (int) getpid());
- free(tmp_dir_strdup);
if (mkdtemp(tmp_dir) == NULL)
{