diff options
Diffstat (limited to 'crypto/heimdal/lib/asn1/lex.l')
-rw-r--r-- | crypto/heimdal/lib/asn1/lex.l | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/crypto/heimdal/lib/asn1/lex.l b/crypto/heimdal/lib/asn1/lex.l index ffb6fd5..21665fb 100644 --- a/crypto/heimdal/lib/asn1/lex.l +++ b/crypto/heimdal/lib/asn1/lex.l @@ -1,6 +1,6 @@ %{ /* - * Copyright (c) 1997 - 2000 Kungliga Tekniska Högskolan + * Copyright (c) 1997 - 2001 Kungliga Tekniska Högskolan * (Royal Institute of Technology, Stockholm, Sweden). * All rights reserved. * @@ -32,7 +32,7 @@ * SUCH DAMAGE. */ -/* $Id: lex.l,v 1.15 2000/07/02 04:08:02 assar Exp $ */ +/* $Id: lex.l,v 1.16 2001/04/18 13:08:47 joda Exp $ */ #ifdef HAVE_CONFIG_H #include <config.h> @@ -80,7 +80,10 @@ EXTERNAL { return EXTERNAL; } "]" { return *yytext; } ::= { return EEQUAL; } --[^\n]*\n { ++lineno; } --?[0-9]+ { yylval.constant = atoi(yytext); return CONSTANT; } +-?(0x)?[0-9]+ { char *e; yylval.constant = strtol(yytext, &e, 0); + if(e == yytext) + error_message("malformed constant (%s)", yytext); + else return CONSTANT; } [A-Za-z][-A-Za-z0-9_]* { yylval.name = strdup (yytext); return IDENTIFIER; } [ \t] ; \n { ++lineno; } |