summaryrefslogtreecommitdiff
path: root/nfa.c
diff options
context:
space:
mode:
authorVern Paxson <vern@ee.lbl.gov>1989-05-25 11:48:20 +0000
committerVern Paxson <vern@ee.lbl.gov>1989-05-25 11:48:20 +0000
commitd528679da50e1c9fd33459b7d2a5a64de16c783f (patch)
treeb98b91e9992e1aa0bdaba6a5ce24edf0ec27bca5 /nfa.c
parente831ac409985484419486fabe3ca605b4646126f (diff)
Split copyright string. Added check for empty machine in dupmachine().
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;