summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRasmus Villemoes <[email protected]>2026-07-08 22:37:04 +0200
committerTom Rini <[email protected]>2026-07-21 13:51:06 -0600
commit6b58f877bdd70003b6c57b540693c2e188b8cc8a (patch)
treee141ce11986755eacf353ce131097b3baaea40c7
parent210fedfcfc1a146faac67dddb3581c6b9dcd01b4 (diff)
string: correct documentation for strstr and strnstr
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]>
-rw-r--r--lib/string.c3
1 files changed, 1 insertions, 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
*/