Check paths in blerglatest
authorChip Black <bytex64@bytex64.net>
Thu, 2 Jan 2014 10:30:36 +0000 (04:30 -0600)
committerChip Black <bytex64@bytex64.net>
Sat, 29 Mar 2014 03:56:24 +0000 (22:56 -0500)
tools/blerglatest.c

index c0279af..eaf887e 100644 (file)
@@ -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;