aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMattias Andrée <maandree@member.fsf.org>2015-12-18 23:17:14 +0100
committerMattias Andrée <maandree@member.fsf.org>2015-12-18 23:17:14 +0100
commit6b0b5bd2ad07b1bea710d304c3cee3f28720d7ba (patch)
tree8c252574ef13533db05b6bac13b812bef46d9748
parentwe need signed integer representation conversion (diff)
downloadslibc-6b0b5bd2ad07b1bea710d304c3cee3f28720d7ba.tar.gz
slibc-6b0b5bd2ad07b1bea710d304c3cee3f28720d7ba.tar.bz2
slibc-6b0b5bd2ad07b1bea710d304c3cee3f28720d7ba.tar.xz
fix issue #7 on github
Signed-off-by: Mattias Andrée <maandree@member.fsf.org>
Diffstat (limited to '')
-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 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);