aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-25 09:49:24 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2023-03-25 09:49:24 +0100
commit09a157d307f3dd766912a203347069b11fed1aa1 (patch)
treef40fac1be122f4bed0b544f078de184c2b19f7e2
parentb3ef22ac2ae126951c5b74003c7b17189c0ecbbb (diff)
downloadslcl-09a157d307f3dd766912a203347069b11fed1aa1.tar.gz
main.c: Use S_ISDIR in ensure_dir
-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;
}