]> git.mdlowis.com Git - archive/afm.git/commitdiff
include space for terminating null in path
authora bellenir <a@bellenir.com>
Sat, 26 Jul 2014 01:24:55 +0000 (01:24 +0000)
committera bellenir <a@bellenir.com>
Sat, 26 Jul 2014 01:24:55 +0000 (01:24 +0000)
source/screen.c

index 64c1cc3456ccf12f74d77ba8468e5ac5db1646d8..93aa93ea7b87e81f5b7ee44a3c9634ed5a85e607 100644 (file)
@@ -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;