summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012-11-17 20:04:36 -0500
committerRich Felker <dalias@aerifal.cx>2012-11-17 20:04:36 -0500
commit71955b2ff88b40446611142429416536c709c961 (patch)
tree1852a366c74530f57c6f49813f8da71d63ca7aad
parentd0197ff03100c716937900fc9c32042ab5581d4a (diff)
downloadmusl-71955b2ff88b40446611142429416536c709c961.tar.gz
musl-71955b2ff88b40446611142429416536c709c961.tar.bz2
musl-71955b2ff88b40446611142429416536c709c961.tar.xz
musl-71955b2ff88b40446611142429416536c709c961.zip
fix typo in dynamic linker path file loading code
fortunately the memory corruption could not hurt anything, but it prevented clearing the final newline and thus prevented the last path element from working.
-rw-r--r--src/ldso/dynlink.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/ldso/dynlink.c b/src/ldso/dynlink.c
index ba2f6129..66f22bef 100644
--- a/src/ldso/dynlink.c
+++ b/src/ldso/dynlink.c
@@ -481,7 +481,7 @@ static struct dso *load_library(const char *name)
if (getline(&sys_path, (size_t[1]){0}, f) > 0) {
size_t l = strlen(sys_path);
if (l && sys_path[l-1]=='\n')
- sys_path[-1] = 0;
+ sys_path[l-1] = 0;
}
fclose(f);
}