diff options
author | Ed Maste <emaste@FreeBSD.org> | 2019-04-09 15:52:18 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2019-04-09 15:52:18 +0000 |
commit | 22ccf855bfb771f59f5aaaae1d26d33679fec931 (patch) | |
tree | 255b39821ff3adf775adf3b884a6aff43747f2f9 /lib/libc/string/strstr.c | |
parent | 9bcd7482b2738101585880fe0a90d6f1bf364524 (diff) |
Notes
Diffstat (limited to 'lib/libc/string/strstr.c')
-rw-r--r-- | lib/libc/string/strstr.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/string/strstr.c b/lib/libc/string/strstr.c index 890a4aba98f5..c17ed8208f18 100644 --- a/lib/libc/string/strstr.c +++ b/lib/libc/string/strstr.c @@ -143,9 +143,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 (mem0 && mem && k < p) k = l-p; + if (k < mem) k = mem; h += k; mem = 0; continue; |