@@ -92,7 +92,7 @@ __memmem (const void *haystack, size_t hs_len,
shift1 = m1 - shift[hash2 (ne + m1)];
shift[hash2 (ne + m1)] = m1;
- for ( ; hs <= end; )
+ do
{
/* Skip past character pairs not in the needle. */
do
@@ -121,7 +121,7 @@ __memmem (const void *haystack, size_t hs_len,
/* Skip based on matching the hash of the needle end. */
hs += shift1;
- }
+ } while (hs <= end);
return NULL;
}
libc_hidden_def (__memmem)
@@ -121,6 +121,7 @@ STRSTR (const char *haystack, const char *needle)
shift1 = m1 - shift[hash2 (ne + m1)];
shift[hash2 (ne + m1)] = m1;
+ goto start;
while (1)
{
if (__glibc_unlikely (hs > end))
@@ -130,6 +131,7 @@ STRSTR (const char *haystack, const char *needle)
return NULL;
}
+start:
/* Skip past character pairs not in the needle. */
do
{