From cab22f2dc3c5f41b5163f74cbb233e390edff6ff Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Tue, 11 Oct 2022 11:16:39 -0400 Subject: add upstream 11.26 --- zen/symlink_target.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'zen/symlink_target.h') 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 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(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! } -- cgit