From eff02b410a65dbf5187159dad5bf4d5f34c2b2a1 Mon Sep 17 00:00:00 2001 From: a bellenir Date: Sat, 26 Jul 2014 01:24:55 +0000 Subject: [PATCH] include space for terminating null in path --- source/screen.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/source/screen.c b/source/screen.c index 64c1cc3..93aa93e 100644 --- a/source/screen.c +++ b/source/screen.c @@ -108,7 +108,7 @@ static void screen_place_windows(void) { //return a pointer to the new block char* pwd(){ char* dir = getcwd(NULL, 0); - char* rid = mem_allocate(sizeof(char)*strlen(dir), NULL); + char* rid = mem_allocate(sizeof(char)*(1+strlen(dir)), NULL); strcpy(rid, dir); free(dir); return rid; -- 2.52.0