diff options
author | Ed Maste <emaste@FreeBSD.org> | 2020-11-19 00:02:12 +0000 |
---|---|---|
committer | Ed Maste <emaste@FreeBSD.org> | 2020-11-19 00:02:12 +0000 |
commit | 7dbcd06e63101d51e6a777f7315cfde794411e53 (patch) | |
tree | 3d61133a9e8857756df782388b2c583dddfd9faf | |
parent | 4874ddfd373c582d9cd7fe915d2259295d75d1e5 (diff) |
Notes
-rw-r--r-- | lib/libc/string/memmem.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/string/memmem.c b/lib/libc/string/memmem.c index 27863b9db623..9e7bf94b1464 100644 --- a/lib/libc/string/memmem.c +++ b/lib/libc/string/memmem.c @@ -153,8 +153,8 @@ twoway_memmem(const unsigned char *h, const unsigned char *z, if (BITOP(byteset, h[l - 1], &)) { k = l - shift[h[l - 1]]; if (k) { - if (mem0 && mem && k < p) - k = l - p; + if (k < mem) + k = mem; h += k; mem = 0; continue; |