if (symlink(lnk_path, task->dst.name) == -1)
{
- char buf[PATH_MAX];
+ char *buf;
if (errno == EEXIST)
{
}
if (symlink(lnk_path, task->dst.name) == -1)
{
- strncpy(buf, lnk_path, sizeof(buf) - 1);
+ buf = strdupa(lnk_path);
free(lnk_path);
_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, "Cannot create link from '%s' to '%s': %s.", buf, task->dst.name);
}
}
else
{
- strncpy(buf, lnk_path, sizeof(buf) - 1);
+ buf = strdupa(lnk_path);
free(lnk_path);
_E_FM_OP_ERROR_SEND_WORK(task, E_FM_OP_ERROR, "Cannot create link from '%s' to '%s': %s.", buf, task->dst.name);
}