diff options
author | assar <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
---|---|---|
committer | assar <assar@FreeBSD.org> | 2001-06-21 02:12:07 +0000 |
commit | 0c8fa354358381b3f1b92598e7f1b46f8cf744cc (patch) | |
tree | ed28ffb73cc0ae48a9892dab3f10b09bc36436d5 /crypto/heimdal/lib/asn1/lex.l | |
parent | 06c859ecf534f468a52f24a3eb14409d73a4907c (diff) | |
download | FreeBSD-src-0c8fa354358381b3f1b92598e7f1b46f8cf744cc.zip FreeBSD-src-0c8fa354358381b3f1b92598e7f1b46f8cf744cc.tar.gz |
import of heimdal 0.3f
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; } |