The len parameter for strnstr() concerns the maximum size of the haystack to consider, not the length of the needle being searched for.
strstr() obviously has no len parameter, so remove the copy-pasta. Reviewed-by: Simon Glass <[email protected]> Signed-off-by: Rasmus Villemoes <[email protected]> --- lib/string.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/lib/string.c b/lib/string.c index a76dcd48d20..45f0f5f8d09 100644 --- a/lib/string.c +++ b/lib/string.c @@ -702,7 +702,7 @@ void *memdup(const void *src, size_t len) * * @s1: string to be searched * @s2: string to search for - * @len: maximum number of characters in s2 to consider + * @len: maximum number of characters in s1 to consider * * Return: pointer to the first occurrence or NULL */ @@ -728,7 +728,6 @@ char *strnstr(const char *s1, const char *s2, size_t len) * * @s1: string to be searched * @s2: string to search for - * @len: maximum number of characters in s2 to consider * * Return: pointer to the first occurrence or NULL */ -- 2.55.0

