From 128ca847c9272ba8ab7b6cfba6d83a001d49947d Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 18 Dec 2015 23:19:14 +0100 Subject: fix issue #7 on github, again MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: Mattias Andrée --- src/stdlib/relpath.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src') 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); -- cgit v1.2.3-70-g09d2