summaryrefslogtreecommitdiff
path: root/flex.skl
diff options
context:
space:
mode:
authorJohn Millaway <john43@users.sourceforge.net>2002-08-12 19:36:58 +0000
committerJohn Millaway <john43@users.sourceforge.net>2002-08-12 19:36:58 +0000
commit8e17ac67aacb7302d46627960b9aa41de3a5ef5e (patch)
tree31d30ccb249a89164a9a76bfd7f6c4ea0cf32476 /flex.skl
parent43843ddad0cb55efd2763578d965b3f7eacfc57b (diff)
Fixed type mismatch in printf.
yylex_init now reports errors.
Diffstat (limited to 'flex.skl')
-rw-r--r--flex.skl17
1 files changed, 15 insertions, 2 deletions
diff --git a/flex.skl b/flex.skl
index b34572f..668aec3 100644
--- a/flex.skl
+++ b/flex.skl
@@ -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 */