aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--main.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/main.c b/main.c
index 8e070ba..66328a8 100644
--- a/main.c
+++ b/main.c
@@ -1153,6 +1153,11 @@ static int ensure_dir(const char *const dir)
return -1;
}
}
+ else if (!S_ISDIR(sb.st_mode))
+ {
+ fprintf(stderr, "%s: %s not a directory\n", __func__, dir);
+ return -1;
+ }
return 0;
}