Remove special cases for EXPR_ERROR and TYPE_ERROR from constant folding and type...
[cparser] / lexer.c
diff --git a/lexer.c b/lexer.c
index 3a2a748..8a339aa 100644 (file)
--- a/lexer.c
+++ b/lexer.c
@@ -19,6 +19,7 @@
  */
 #include <config.h>
 
+#include "adt/strutil.h"
 #include "input.h"
 #include "diagnostic.h"
 #include "lexer.h"
@@ -323,8 +324,8 @@ finish_suffix:
        }
 
        obstack_1grow(&symbol_obstack, '\0');
-       size_t    size   = obstack_object_size(&symbol_obstack);
-       char     *string = obstack_finish(&symbol_obstack);
+       size_t size   = obstack_object_size(&symbol_obstack) - 1;
+       char  *string = obstack_finish(&symbol_obstack);
 
        lexer_token.number.suffix = identify_string(string, size);
 }
@@ -910,7 +911,7 @@ static void parse_line_directive(void)
                         *
                         * currently we're only interested in "3"
                         */
-                       if (strcmp(pp_token.number.number.begin, "3") == 0) {
+                       if (streq(pp_token.number.number.begin, "3")) {
                                lexer_pos.is_system_header = true;
                        }
                        next_pp_token();