summaryrefslogtreecommitdiff
path: root/zen/symlink_target.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-10-19 10:53:07 -0400
committerB. Stack <bgstack15@gmail.com>2022-10-19 10:53:07 -0400
commita53560254596460a4778a27f50b89ce92f810055 (patch)
tree551fdc08cbece3cca567d04870b91eaa115a4675 /zen/symlink_target.h
parentMerge branch 'b11.26' into 'master' (diff)
downloadFreeFileSync-11.27.tar.gz
FreeFileSync-11.27.tar.bz2
FreeFileSync-11.27.zip
add upstream 11.2711.27
Diffstat (limited to 'zen/symlink_target.h')
-rw-r--r--zen/symlink_target.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/zen/symlink_target.h b/zen/symlink_target.h
index 44c15ab2..89c00571 100644
--- a/zen/symlink_target.h
+++ b/zen/symlink_target.h
@@ -47,7 +47,7 @@ zen::SymlinkRawContent getSymlinkRawContent_impl(const Zstring& linkPath) //thro
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!
+ if (makeUnsigned(bytesWritten) >= 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 {.targetPath = Zstring(buf.data(), bytesWritten)}; //readlink does not append 0-termination!
bgstack15