]> jfr.im git - irc/rizon/plexus4.git/commitdiff
conf.c: fixed a lineno off-by-one for parser warnings in included configuration files
authormichael <redacted>
Sat, 1 Oct 2016 18:45:00 +0000 (14:45 -0400)
committerAdam <redacted>
Sat, 1 Oct 2016 18:45:00 +0000 (14:45 -0400)
src/conf.c

index a9bf9dfe3e18e32404206dcbd768c9f7082dcddd..a8577c350f7315d53a619b92feb083edd5db7476 100644 (file)
@@ -1323,7 +1323,7 @@ validate_conf(void)
 static void
 read_conf(FILE *file)
 {
-  lineno = 0;
+  lineno = 1;
 
   set_default_conf(); /* Set default values prior to conf parsing */
   conf_parser_ctx.pass = 1;
@@ -1829,9 +1829,9 @@ yyerror(const char *msg)
   strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf));
   sendto_snomask(SNO_ALL, L_ADMIN,
                  "\"%s\", line %u: %s: %s",
-                 conffilebuf, lineno + 1, msg, newlinebuf);
+                 conffilebuf, lineno, msg, newlinebuf);
   ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s",
-       conffilebuf, lineno + 1, msg, newlinebuf);
+       conffilebuf, lineno, msg, newlinebuf);
 }
 
 void
@@ -1842,9 +1842,9 @@ conf_error_report(const char *msg)
   strip_tabs(newlinebuf, linebuf, sizeof(newlinebuf));
   sendto_snomask(SNO_ALL, L_ADMIN,
                  "\"%s\", line %u: %s: %s",
-                 conffilebuf, lineno + 1, msg, newlinebuf);
+                 conffilebuf, lineno, msg, newlinebuf);
   ilog(LOG_TYPE_IRCD, "\"%s\", line %u: %s: %s",
-       conffilebuf, lineno + 1, msg, newlinebuf);
+       conffilebuf, lineno, msg, newlinebuf);
 }
 
 /*