diff --git a/FuseRedSea.c b/FuseRedSea.c index c2e43f9..77e4aa6 100644 --- a/FuseRedSea.c +++ b/FuseRedSea.c @@ -217,7 +217,7 @@ void redsea_read_files(struct redsea_directory* directory, unsigned char *path_s if (directory_count+1 >= max_directory_count) { expand_directory_array(); } - directory_paths[directory_count] = malloc(strlen(path)); + directory_paths[directory_count] = malloc(strlen(path)+1); strcpy(directory_paths[directory_count], path); struct redsea_directory* directory_entry = malloc(sizeof(struct redsea_directory)); strcpy(directory_entry->name, name); diff --git a/makefile b/makefile index 6535b98..6178b6a 100644 --- a/makefile +++ b/makefile @@ -1,4 +1,6 @@ redseabuild: gcc -I/usr/include/fuse -lfuse FuseRedSea.c -o redsea +debug: + gcc -Wall -g -O0 -I/usr/include/fuse -lfuse FuseRedSea.c -o redsea all: redseabuild