summaryrefslogtreecommitdiff
path: root/zen/symlink_target.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-10-11 15:17:59 +0000
committerB. Stack <bgstack15@gmail.com>2022-10-11 15:17:59 +0000
commit38c826621a39831d1bdc78aa9e45cc592db3e77f (patch)
treea49cfd729d9793681a57fa6f7409b0f0848e9ede /zen/symlink_target.h
parentMerge branch 'b11.25' into 'master' (diff)
parentadd upstream 11.26 (diff)
downloadFreeFileSync-38c826621a39831d1bdc78aa9e45cc592db3e77f.tar.gz
FreeFileSync-38c826621a39831d1bdc78aa9e45cc592db3e77f.tar.bz2
FreeFileSync-38c826621a39831d1bdc78aa9e45cc592db3e77f.zip
Merge branch 'b11.26' into 'master'11.26
add upstream 11.26 See merge request opensource-tracking/FreeFileSync!49
Diffstat (limited to 'zen/symlink_target.h')
-rw-r--r--zen/symlink_target.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/zen/symlink_target.h b/zen/symlink_target.h
index ada4e358..44c15ab2 100644
--- a/zen/symlink_target.h
+++ b/zen/symlink_target.h
@@ -44,13 +44,13 @@ zen::SymlinkRawContent getSymlinkRawContent_impl(const Zstring& linkPath) //thro
const size_t bufSize = 10000;
std::vector<char> buf(bufSize);
- const ssize_t bytesWritten = ::readlink(linkPath.c_str(), &buf[0], bufSize);
+ const ssize_t bytesWritten = ::readlink(linkPath.c_str(), buf.data(), bufSize);
if (bytesWritten < 0)
THROW_LAST_FILE_ERROR(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), "readlink");
if (bytesWritten >= static_cast<ssize_t>(bufSize)) //detect truncation; not an error for readlink!
throw FileError(replaceCpy(_("Cannot resolve symbolic link %x."), L"%x", fmtPath(linkPath)), formatSystemError("readlink", L"", L"Buffer truncated."));
- return {Zstring(&buf[0], bytesWritten)}; //readlink does not append 0-termination!
+ return {.targetPath = Zstring(buf.data(), bytesWritten)}; //readlink does not append 0-termination!
}
bgstack15