about summary refs log tree commit diff
path: root/src/libexpr
diff options
context:
space:
mode:
authorEelco Dolstra <edolstra@gmail.com>2018-05-11T10·02+0200
committerEelco Dolstra <edolstra@gmail.com>2018-05-11T10·05+0200
commit1ad19232c4bbecb06e6acbb2a3a538544a28e1f2 (patch)
tree52ee9c2745698691e031fd249c872f5e04e349f7 /src/libexpr
parentf3c85f9eb395b13790d1fced05665125e2ec81ca (diff)
Don't return negative numbers from the flex tokenizer
Fixes #1374.
Closes #2129.
Diffstat (limited to 'src/libexpr')
-rw-r--r--src/libexpr/lexer.l6
1 files changed, 5 insertions, 1 deletions
diff --git a/src/libexpr/lexer.l b/src/libexpr/lexer.l
index 8855d794ea98..29ca327c1e4e 100644
--- a/src/libexpr/lexer.l
+++ b/src/libexpr/lexer.l
@@ -209,7 +209,11 @@ or          { return OR_KW; }
 \#[^\r\n]*    /* single-line comments */
 \/\*([^*]|\*+[^*/])*\*+\/  /* long comments */
 
-{ANY}           return yytext[0];
+{ANY}       {
+              /* Don't return a negative number, as this will cause
+                 Bison to stop parsing without an error. */
+              return (unsigned char) yytext[0];
+            }
 
 }