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 a5a249f2..3b1ae183 100644
--- a/src/string/memmem.c
+++ b/src/string/memmem.c
@@ -120,7 +120,7 @@ static char *twoway_memmem(const unsigned char *h, const unsigned char *z, const
 		}
 		/* Compare left half */
 		for (k=ms+1; k>mem && n[k-1] == h[k-1]; k--);
-		if (k == mem) return (char *)h;
+		if (k <= mem) return (char *)h;
 		h += p;
 		mem = mem0;
 	}