* util.cxx (follow_link): Correctly terminate strings after calling
readlink().
if (linkname)
{
r = readlink(f, linkname, st.st_size + 1);
- linkname[st.st_size] = '\0';
+ if (r != -1)
+ linkname[r] = '\0';
/*
* If we have non-empty sysroot and we got link that
* points to absolute path name, we need to look at
if (linkname)
{
r = readlink(f1, linkname, st.st_size + 1);
- linkname[st.st_size] = '\0';
+ if (r != -1)
+ linkname[r] = '\0';
}
}
else