summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/main.c b/main.c
index ccd2a73..d8accff 100644
--- a/main.c
+++ b/main.c
@@ -159,7 +159,9 @@ void remove_dir(const char *path) {
if (dP == NULL) {
perror("failed to open the directory to delete the files recursively");
+
}
+ else {
while ((entry = readdir(dP)) != NULL && rmdir(path) != 0){
if (strcmp(entry->d_name, "." ) == 0 || strcmp(entry->d_name, "..")== 0){
@@ -169,6 +171,7 @@ void remove_dir(const char *path) {
else if (remove(entry->d_name) != 0) {
printf("%p", entry->d_name);
perror("failed to delete the directory 02");
+ }
}
}
printf("%p", dP);