]> git.armaanb.net Git - opendoas.git/blobdiff - doas.c
Add copyright clauses to new code.
[opendoas.git] / doas.c
diff --git a/doas.c b/doas.c
index 9862520852a4bd1be6bf285e958820368aef7d6f..6fabd7bf1b9887dbf65f1d60f1f8cd906623b455 100644 (file)
--- a/doas.c
+++ b/doas.c
@@ -45,9 +45,11 @@ arraylen(const char **arr)
 {
        size_t cnt = 0;
 
-       while (*arr) {
-               cnt++;
-               arr++;
+       if (arr) {
+               while (*arr) {
+                       cnt++;
+                       arr++;
+               }
        }
        return cnt;
 }
@@ -162,10 +164,7 @@ parseconfig(const char *filename, int checkperms)
 
        yyfp = fopen(filename, "r");
        if (!yyfp) {
-               if (checkperms)
-                       fprintf(stderr, "doas is not enabled.\n");
-               else
-                       warn("could not open config file");
+               warn("could not open config file");
                exit(1);
        }