diff --git a/src/version.cpp b/src/version.cpp index afe94fb4..6f5dfba5 100644 --- a/src/version.cpp +++ b/src/version.cpp @@ -164,7 +164,7 @@ static std::vector getLoadedLibraries() { char procsz[100]; char pathsz[500]; snprintf(procsz, sizeof(procsz), "/proc/%d/path/a.out", getpid()); - int l = readlink(procsz, pathsz, sizeof(pathsz)); + int l = readlink(procsz, pathsz, sizeof(pathsz) - 1); if (l > 0) { pathsz[l] = '\0'; path.assign(pathsz);