summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbdellah El Morabit <nsrddyn@gmail.com>2025-02-25 20:10:31 +0100
committerAbdellah El Morabit <nsrddyn@gmail.com>2025-02-25 20:10:31 +0100
commita9a967642be399d21211519751e9a84b217fcd1d (patch)
treea70ce6dc9847e0e64c92b5071c729c3f2ab04cc9
parenteafff8845db6c81384beee5d72ac30a4c9cd1972 (diff)
fixed some bad code by calling it bad code in a coment
-rwxr-xr-xa.outbin0 -> 51736 bytes
-rw-r--r--main.c18
2 files changed, 9 insertions, 9 deletions
diff --git a/a.out b/a.out
new file mode 100755
index 0000000..0ec461a
--- /dev/null
+++ b/a.out
Binary files differ
diff --git a/main.c b/main.c
index d8accff..2b2e599 100644
--- a/main.c
+++ b/main.c
@@ -162,15 +162,15 @@ void remove_dir(const char *path) {
}
else {
-
- while ((entry = readdir(dP)) != NULL && rmdir(path) != 0){
- if (strcmp(entry->d_name, "." ) == 0 || strcmp(entry->d_name, "..")== 0){
- printf("%p",entry->d_name);
- continue;
- }
- else if (remove(entry->d_name) != 0) {
- printf("%p", entry->d_name);
- perror("failed to delete the directory 02");
+// bad code, should be rewritten dont look at it!!!
+ while ((entry = readdir(dP)) != NULL && rmdir(path) != 0){
+ if (strcmp(entry->d_name, "." ) == 0 || strcmp(entry->d_name, "..")== 0){
+ printf("%p",entry->d_name);
+ continue;
+ }
+ else if (remove(entry->d_name) != 0) {
+ printf("%p", entry->d_name);
+ perror("failed to delete the directory 02");
}
}
}