Code

conf: convert runtime check to assertion
authorMax Kellermann <max@duempel.org>
Fri, 8 Nov 2013 18:36:49 +0000 (19:36 +0100)
committerMax Kellermann <max@duempel.org>
Fri, 8 Nov 2013 18:36:49 +0000 (19:36 +0100)
src/conf.c

index 0166f6fd6b6c18ddf8a82d713412d49612a2e01b..87dd310cb815e0ef8c68ea06f17aa9477f607467 100644 (file)
@@ -25,6 +25,7 @@
 #include "colors.h"
 #include "screen_list.h"
 
+#include <assert.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <errno.h>
@@ -565,12 +566,11 @@ parse_line(char *line)
 static int
 read_rc_file(char *filename)
 {
+       assert(filename != NULL);
+
        FILE *file;
        char line[MAX_LINE_LENGTH];
 
-       if (filename == NULL)
-               return -1;
-
        file = fopen(filename, "r");
        if (file == NULL) {
                        perror(filename);