summaryrefslogtreecommitdiff
path: root/zen/symlink_target.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-02-06 16:41:53 -0500
committerB. Stack <bgstack15@gmail.com>2022-02-06 16:41:53 -0500
commitf6b6d222dc1a79c95f6756c707c5fcc3a785c030 (patch)
tree374c62790fde0ce5514ef56750d0ff023d61b528 /zen/symlink_target.h
parentadd upstream 11.16 (diff)
downloadFreeFileSync-f6b6d222dc1a79c95f6756c707c5fcc3a785c030.tar.gz
FreeFileSync-f6b6d222dc1a79c95f6756c707c5fcc3a785c030.tar.bz2
FreeFileSync-f6b6d222dc1a79c95f6756c707c5fcc3a785c030.zip
add upstream 11.17
Diffstat (limited to 'zen/symlink_target.h')
-rw-r--r--zen/symlink_target.h10
1 files changed, 5 insertions, 5 deletions
diff --git a/zen/symlink_target.h b/zen/symlink_target.h
index 60353292..4f007047 100644
--- a/zen/symlink_target.h
+++ b/zen/symlink_target.h
@@ -43,16 +43,16 @@ namespace
zen::SymlinkRawContent getSymlinkRawContent_impl(const Zstring& linkPath) //throw FileError
{
using namespace zen;
- const size_t BUFFER_SIZE = 10000;
- std::vector<char> buffer(BUFFER_SIZE);
+ const size_t bufSize = 10000;
+ std::vector<char> buf(bufSize);
- const ssize_t bytesWritten = ::readlink(linkPath.c_str(), &buffer[0], BUFFER_SIZE);
+ const ssize_t bytesWritten = ::readlink(linkPath.c_str(), &buf[0], 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>(BUFFER_SIZE)) //detect truncation; not an error for 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(&buffer[0], bytesWritten)}; //readlink does not append 0-termination!
+ return {Zstring(&buf[0], bytesWritten)}; //readlink does not append 0-termination!
}
bgstack15