summaryrefslogtreecommitdiff
path: root/main.c
diff options
context:
space:
mode:
Diffstat (limited to 'main.c')
-rw-r--r--main.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/main.c b/main.c
index 17e0469..80a5fe7 100644
--- a/main.c
+++ b/main.c
@@ -22,6 +22,10 @@ void test() {
void ls(const char *path) {
struct dirent *entry;
+ if (path == NULL) {
+ printf("No path found\n");
+ return;
+ }
DIR *dP = opendir(path);
// check if the directory got opened successfully