aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-18 23:19:14 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-18 23:19:14 +0100
commit128ca847c9272ba8ab7b6cfba6d83a001d49947d (patch)
tree28b35c718f873eea7db03779c146095e22403c49 /src
parentfix issue #7 on github (diff)
downloadslibc-128ca847c9272ba8ab7b6cfba6d83a001d49947d.tar.gz
slibc-128ca847c9272ba8ab7b6cfba6d83a001d49947d.tar.bz2
slibc-128ca847c9272ba8ab7b6cfba6d83a001d49947d.tar.xz
fix issue #7 on github, again
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to 'src')
-rw-r--r--src/stdlib/relpath.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdlib/relpath.c b/src/stdlib/relpath.c
index bd9e733..93daad9 100644
--- a/src/stdlib/relpath.c
+++ b/src/stdlib/relpath.c
@@ -57,7 +57,7 @@ char* relpath(const char* file, const char* ref) /* XXX may also fail as get_cur
if (absref == NULL)
{
p = strlen(cwd);
- absref = malloc((p + 1) * sizeof(char));
+ absref = malloc((p + 2) * sizeof(char));
if (absref == NULL)
goto fail;
memcpy(absref, cwd, p);