From: David du Colombier <0intro@gmail.com> Date: Sat, 7 Oct 2017 13:17:02 +0000 (+0200) Subject: exits loop when inst is null X-Git-Url: https://git.mdlowis.com/?a=commitdiff_plain;h=9e062992801d21d8284ec6c9afb9aba259689da7;p=proto%2Flibregexp.git exits loop when inst is null --- 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){