lib: implement strnstr()

Implement library function strnstr().
Implement strstr() using strnstr().
Sort the includes.

Signed-off-by: Heinrich Schuchardt <heinrich.schuchardt@canonical.com>
Reviewed-by: Ilias Apalodimas <ilias.apalodimas@linaro.org>
[jf: replace <stdint.h> by <limits.h>, folded from next patch]
Signed-off-by: Jerome Forissier <jerome.forissier@linaro.org>
This commit is contained in:
Heinrich Schuchardt
2025-02-03 10:12:00 +01:00
committed by Tom Rini
parent 10917df17f
commit 7c7361b98d
2 changed files with 45 additions and 23 deletions

View File

@@ -72,6 +72,9 @@ extern char * strrchr(const char *,int);
#ifndef __HAVE_ARCH_STRSTR
extern char * strstr(const char *,const char *);
#endif
#ifndef __HAVE_ARCH_STRNSTR
extern char *strnstr(const char *, const char *, size_t);
#endif
#ifndef __HAVE_ARCH_STRLEN
extern __kernel_size_t strlen(const char *);
#endif