commit:c3dc504dba51c69bf0df1b5fdfaf980409bb6143
author:Chip Black
committer:Chip Black
date:Thu Jan 2 04:30:36 2014 -0600
parents:299baeb1e1f2599aec5f6d2dd229f2bf0a1922b7
Check paths in blerglatest
diff --git a/tools/blerglatest.c b/tools/blerglatest.c
line changes: +5/-0
index c0279af..eaf887e
--- a/tools/blerglatest.c
+++ b/tools/blerglatest.c
@@ -83,6 +83,11 @@ struct things * latest_things(const char *path, const char *file, int minlen) {
 	int i;
 
 	d = opendir(path);
+	if (d == NULL) {
+		fprintf(stderr, "Could not open %s: ", path);
+		perror("");
+		exit(1);
+	}
 	while (f = readdir(d)) {
 		if (f->d_name[0] == '.') continue;
 		if (minlen > 0 && strlen(f->d_name) < minlen) continue;