From: a bellenir Date: Sat, 26 Jul 2014 01:24:55 +0000 (+0000) Subject: include space for terminating null in path X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=eff02b410a65dbf5187159dad5bf4d5f34c2b2a1;p=archive%2Fafm.git include space for terminating null in path --- 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;