summaryrefslogtreecommitdiff
path: root/nfa.c
diff options
context:
space:
mode:
Diffstat (limited to 'nfa.c')
-rw-r--r--nfa.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/nfa.c b/nfa.c
index d1c6f4e..d386037 100644
--- a/nfa.c
+++ b/nfa.c
@@ -27,8 +27,8 @@
#ifndef lint
static char copyright[] =
- "@(#) Copyright (c) 1989 The Regents of the University of California.\n\
- All rights reserved.\n";
+ "@(#) Copyright (c) 1989 The Regents of the University of California.\n";
+static char CR_continuation[] = "@(#) All rights reserved.\n";
static char rcsid[] =
"@(#) $Header$ (LBL)";
@@ -159,7 +159,9 @@ int dupmachine( mach )
int mach;
{
- int i, state, init, last = lastst[mach], state_offset;
+ int i, init, state_offset;
+ int state = 0;
+ int last = lastst[mach];
for ( i = firstst[mach]; i <= last; ++i )
{
@@ -176,6 +178,9 @@ int mach;
accptnum[state] = accptnum[i];
}
+ if ( state == 0 )
+ flexfatal( "empty machine in dupmachine()" );
+
state_offset = state - i + 1;
init = mach + state_offset;