X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstring%2Fstrstr.c;h=55ba1c7b45a0ef0b7087754684055aa0e84d27ce;hb=2f2348c9588d61680123bbe438db38acf5dfea4c;hp=c7d6668265dc03610451f2f47e991dc155d81148;hpb=0239cd0681e889a269fb7691f60e81ef8d081e6b;p=musl diff --git a/src/string/strstr.c b/src/string/strstr.c index c7d66682..55ba1c7b 100644 --- a/src/string/strstr.c +++ b/src/string/strstr.c @@ -109,7 +109,7 @@ static char *twoway_strstr(const unsigned char *h, const unsigned char *n) if (BITOP(byteset, h[l-1], &)) { k = l-shift[h[l-1]]; if (k) { - if (mem && k < p) k = l-p; + if (k < mem) k = mem; h += k; mem = 0; continue;