about summary refs log tree commit diff
path: root/src/string/memmem.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/string/memmem.c')
-rw-r--r--src/string/memmem.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/string/memmem.c b/src/string/memmem.c
index ce3cd190..58a21fcd 100644
--- a/src/string/memmem.c
+++ b/src/string/memmem.c
@@ -100,7 +100,7 @@ static char *twoway_memmem(const unsigned char *h, const unsigned char *z, const
 		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;