From 3ac159fe063cae7590a10d9dfcd1ae0a6554e6b4 Mon Sep 17 00:00:00 2001 From: a bellenir Date: Sat, 26 Jul 2014 02:55:25 +0000 Subject: [PATCH] offbyone --- source/workdir.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/workdir.c b/source/workdir.c index d663818..8789ebc 100644 --- a/source/workdir.c +++ b/source/workdir.c @@ -78,7 +78,7 @@ char* workdir_cd_up(WorkDir_T* wd){ newpath = mem_allocate(sizeof(char)*2, NULL); strcpy(newpath, "/"); } else { - newpath = mem_allocate(sizeof(char)*last_slash, NULL); + newpath = mem_allocate(sizeof(char)*(1+last_slash), NULL); strncpy(newpath, wd->path, last_slash); newpath[last_slash] = 0; } -- 2.54.0