readProcLink: Replace unnecessary value judgement by actual info

This commit is contained in:
Robert Hensing 2023-11-16 11:33:10 +01:00
parent 12c91a823e
commit 9fa133dde5

View file

@ -339,7 +339,7 @@ static void readProcLink(const std::string & file, UncheckedRoots & roots)
throw SysError("reading symlink"); throw SysError("reading symlink");
} }
if (res == bufsiz) { if (res == bufsiz) {
throw Error("stupidly long symlink"); throw Error("overly long symlink starting with '%1%'", std::string_view(buf, bufsiz));
} }
if (res > 0 && buf[0] == '/') if (res > 0 && buf[0] == '/')
roots[std::string(static_cast<char *>(buf), res)] roots[std::string(static_cast<char *>(buf), res)]