musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
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.c 2
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;
}
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月29日 07:15:34 +0000

AltStyle によって変換されたページ (->オリジナル) /