]> git.mdlowis.com Git - proto/libregexp.git/commitdiff
exits loop when inst is null
authorDavid du Colombier <0intro@gmail.com>
Sat, 7 Oct 2017 13:17:02 +0000 (15:17 +0200)
committerDavid du Colombier <0intro@gmail.com>
Sat, 7 Oct 2017 13:17:02 +0000 (15:17 +0200)
regexec.c

index d8aecc12a721bc0b3c20a3627a1e950291f5a19d..df75cf1dda3b442e9974d76eb803d2e1f73056a9 100644 (file)
--- 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){