patplex: Fixed segfault bug in pattern replacement.
authorFredrik Tolf <fredrik@dolda2000.com>
Mon, 10 Nov 2014 21:11:28 +0000 (22:11 +0100)
committerFredrik Tolf <fredrik@dolda2000.com>
Mon, 10 Nov 2014 21:11:28 +0000 (22:11 +0100)
src/patplex.c

index d0e2dad..9939543 100644 (file)
@@ -383,12 +383,14 @@ static void qoffsets(char *buf, int *obuf, char *pstr, int unquote)
            o++;
        }
        buf[o] = 0;
+       obuf[o] = i;
     } else {
        for(i = 0; pstr[i]; i++) {
            buf[i] = pstr[i];
            obuf[i] = i;
        }
        buf[i] = 0;
+       obuf[i] = i;
     }
 }