diff options
Diffstat (limited to 'convert-dtsv0-lexer.l')
-rw-r--r-- | convert-dtsv0-lexer.l | 25 |
1 files changed, 3 insertions, 22 deletions
diff --git a/convert-dtsv0-lexer.l b/convert-dtsv0-lexer.l index 12b45ea11316..59137f1a798a 100644 --- a/convert-dtsv0-lexer.l +++ b/convert-dtsv0-lexer.l @@ -17,7 +17,7 @@ * USA */ -%option noyywrap nounput +%option noyywrap nounput noinput %x INCLUDE %x BYTESTRING @@ -42,6 +42,7 @@ GAP ({WS}|{COMMENT}|{LINECOMMENT})* #include <fnmatch.h> #include "srcpos.h" +#include "util.h" static int v1_tagged; /* = 0 */ static int cbase = 16; @@ -51,26 +52,6 @@ static char *last_name; /* = NULL */ #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) -static inline void __attribute__((noreturn)) die(char * str, ...) -{ - va_list ap; - - va_start(ap, str); - fprintf(stderr, "FATAL ERROR: "); - vfprintf(stderr, str, ap); - exit(1); -} - -static inline void *xmalloc(size_t len) -{ - void *new = malloc(len); - - if (! new) - die("malloc() failed\n"); - - return new; -} - const struct { const char *pattern; int obase, width; @@ -185,7 +166,7 @@ const struct { <PROPNODENAME>{PROPNODECHAR}+ { ECHO; - last_name = strdup(yytext); + last_name = xstrdup(yytext); BEGIN(INITIAL); } |