chiark / gitweb /
Log write failures on tun device.
[secnet.git] / conffile.fl
index 1747be2..2cfa21b 100644 (file)
@@ -6,6 +6,8 @@
 %option never-interactive
 
 %{
+#include <assert.h>
+#include <limits.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
@@ -33,7 +35,7 @@ struct include_stack_item {
 struct include_stack_item include_stack[MAX_INCLUDE_DEPTH];
 int include_stack_ptr=0;
 
-uint32_t config_lineno=0;
+int config_lineno=0;
 cstring_t config_file="xxx";
 
 static struct p_node *leafnode(uint32_t type)
@@ -100,6 +102,7 @@ include                     BEGIN(incl);
        Message(M_FATAL,"config file %s line %d: %s\n",config_file,
                config_lineno,"``include'' requires a filename");
        BEGIN(INITIAL);
+       assert(config_lineno < INT_MAX);
        ++config_lineno;
        ++yynerrs;
 }