From 6b0b5bd2ad07b1bea710d304c3cee3f28720d7ba Mon Sep 17 00:00:00 2001 From: Mattias Andrée Date: Fri, 18 Dec 2015 23:17:14 +0100 Subject: fix issue #7 on github 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/stdlib') diff --git a/src/stdlib/relpath.c b/src/stdlib/relpath.c index f710523..bd9e733 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 + 1) * sizeof(char)); if (absref == NULL) goto fail; memcpy(absref, cwd, p); -- cgit v1.2.3-70-g09d2