diff options
author | John Millaway <john43@users.sourceforge.net> | 2002-08-12 19:36:58 +0000 |
---|---|---|
committer | John Millaway <john43@users.sourceforge.net> | 2002-08-12 19:36:58 +0000 |
commit | 8e17ac67aacb7302d46627960b9aa41de3a5ef5e (patch) | |
tree | 31d30ccb249a89164a9a76bfd7f6c4ea0cf32476 /flex.skl | |
parent | 43843ddad0cb55efd2763578d965b3f7eacfc57b (diff) |
Fixed type mismatch in printf.
yylex_init now reports errors.
Diffstat (limited to 'flex.skl')
-rw-r--r-- | flex.skl | 17 |
1 files changed, 15 insertions, 2 deletions
@@ -1903,6 +1903,10 @@ static int yy_init_globals YYFARGS0(void) yyin = (FILE *) 0; yyout = (FILE *) 0; #endif + + /* For future reference: Set errno on error, since we are called by + * yylex_init() + */ return 0; } @@ -1919,9 +1923,18 @@ int yylex_init( ptr_yy_globals ) yyscan_t* ptr_yy_globals; #endif { + if (ptr_yy_globals == NULL){ + errno = EINVAL; + return 1; + } + *ptr_yy_globals = (yyscan_t) yyalloc ( sizeof( struct yyguts_t ), NULL ); - yy_init_globals ( *ptr_yy_globals ); - return 0; + if (*ptr_yy_globals == NULL){ + errno = ENOMEM; + return 1; + } + + return yy_init_globals ( *ptr_yy_globals ); } #endif /* End YY_REENTRANT */ |