From: michael Date: Thu, 4 Jun 2015 11:00:32 +0000 (+0000) Subject: - config-lexer.c:ccomment(): cleaned up style issues X-Git-Tag: 1.0.7~10 X-Git-Url: http://git.serene-ircd.net/?a=commitdiff_plain;h=a004d32f2d07e529468fcd1f08979345fcb4f4e9;p=hopm.git - config-lexer.c:ccomment(): cleaned up style issues git-svn-id: svn://svn.ircd-hybrid.org/svnroot/hopm/branches/1.0.x@6041 82007160-df01-0410-b94d-b575c5fd34c7 --- diff --git a/src/config-lexer.l b/src/config-lexer.l index b333e60..2dbb210 100644 --- a/src/config-lexer.l +++ b/src/config-lexer.l @@ -253,33 +253,39 @@ OFF { /* C-comment ignoring routine -kre*/ -void ccomment(void) +void +ccomment(void) { - int c; + int c = 0; /* log(L_NOTICE, "got comment"); */ while (1) { - while ((c = input()) != '*' && c != EOF) - if (c == '\n') ++linenum; - if (c == '*') - { - while ((c = input()) == '*'); - if (c == '/') break; - else if (c == '\n') - ++linenum; - } + while ((c = input()) != '*' && c != EOF) + if (c == '\n') + ++linenum; + + if (c == '*') + { + while ((c = input()) == '*') + /* Nothing */ ; + if (c == '/') + break; + else if (c == '\n') + ++linenum; + } + if (c == EOF) { - YY_FATAL_ERROR("EOF in comment"); - /* XXX hack alert this disables - * the stupid unused function warning - * gcc generates - */ - if(1 == 0) - yy_fatal_error("EOF in comment"); - break; + YY_FATAL_ERROR("EOF in comment"); + + /* XXX hack alert this disables + * the stupid unused function warning + * gcc generates + */ + if (1 == 0) + yy_fatal_error("EOF in comment"); + break; } } } -