]> git.mdlowis.com Git - archive/afm.git/commitdiff
offbyone
authora bellenir <a@bellenir.com>
Sat, 26 Jul 2014 02:55:25 +0000 (02:55 +0000)
committera bellenir <a@bellenir.com>
Sat, 26 Jul 2014 02:55:25 +0000 (02:55 +0000)
source/workdir.c

index d663818af7ba6c039b17353e40953a4d7a10ab85..8789ebc2b6a65ac8c4ce04ae7ff7dbc5e3ef3ee6 100644 (file)
@@ -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;
     }