Parcourir la source

[2372] use the END_OF_STREAM constant instead of hardocded condition of '< 0'

JINMEI Tatuya il y a 12 ans
Parent
commit
5044adfc3d
1 fichiers modifiés avec 1 ajouts et 1 suppressions
  1. 1 1
      src/lib/dns/master_lexer.cc

+ 1 - 1
src/lib/dns/master_lexer.cc

@@ -208,7 +208,7 @@ Start::handle(MasterLexer& lexer, MasterLexer::Options& options,
 {
     while (true) {
         const int c = getLexerImpl(lexer)->source_->getChar();
-        if (c < 0) {
+        if (c == InputSource::END_OF_STREAM) {
             // TODO: handle unbalance cases
             getLexerImpl(lexer)->last_was_eol_ = false;
             getLexerImpl(lexer)->token_ = Token(Token::END_OF_FILE);