From 9e062992801d21d8284ec6c9afb9aba259689da7 Mon Sep 17 00:00:00 2001 From: David du Colombier <0intro@gmail.com> Date: Sat, 7 Oct 2017 15:17:02 +0200 Subject: [PATCH] exits loop when inst is null --- regexec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/regexec.c b/regexec.c index d8aecc1..df75cf1 100644 --- a/regexec.c +++ b/regexec.c @@ -81,7 +81,7 @@ regexec1(Reprog *progp, /* program to run */ /* Execute machine until current list is empty */ for(tlp=tl; tlp->inst; tlp++){ /* assignment = */ - for(inst = tlp->inst; ; inst = inst->l.next){ + for(inst = tlp->inst; inst; inst = inst->l.next){ switch(inst->type){ case RUNE: /* regular character */ if(inst->r.r == r){ -- 2.52.0