summaryrefslogtreecommitdiffstats
path: root/lib/libc/regex/engine.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/regex/engine.c')
-rw-r--r--lib/libc/regex/engine.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/regex/engine.c b/lib/libc/regex/engine.c
index 589bb9d..436370d 100644
--- a/lib/libc/regex/engine.c
+++ b/lib/libc/regex/engine.c
@@ -157,7 +157,7 @@ matcher(struct re_guts *g,
int i;
struct match mv;
struct match *m = &mv;
- const char *dp;
+ const char *dp = NULL;
const sopno gf = g->firststate+1; /* +1 for OEND */
const sopno gl = g->laststate;
const char *start;
@@ -244,7 +244,7 @@ matcher(struct re_guts *g,
ZAPSTATE(&m->mbs);
/* Adjust start according to moffset, to speed things up */
- if (g->moffset > -1)
+ if (dp != NULL && g->moffset > -1)
start = ((dp - g->moffset) < start) ? start : dp - g->moffset;
SP("mloop", m->st, *start);
OpenPOWER on IntegriCloud