X-Git-Url: http://nsz.repo.hu/git/?a=blobdiff_plain;f=src%2Fstring%2Fstrstr.c;h=55ba1c7b45a0ef0b7087754684055aa0e84d27ce;hb=64d0e86576ef1d33e996a926d6a02d38fb88a768;hp=c80e9caf6d9deb14241ba0edd9e5a0d0b349bd27;hpb=8f5a820d147da36bcdbddd201b35d293699dacd8;p=musl diff --git a/src/string/strstr.c b/src/string/strstr.c index c80e9caf..55ba1c7b 100644 --- a/src/string/strstr.c +++ b/src/string/strstr.c @@ -108,9 +108,8 @@ static char *twoway_strstr(const unsigned char *h, const unsigned char *n) /* Check last byte first; advance by shift on mismatch */ if (BITOP(byteset, h[l-1], &)) { k = l-shift[h[l-1]]; - //printf("adv by %zu (on %c) at [%s] (%zu;l=%zu)\n", k, h[l-1], h, shift[h[l-1]], l); if (k) { - if (mem && k < p) k = l-p; + if (k < mem) k = mem; h += k; mem = 0; continue;