diff options
author | Heinrich Schuchardt <heinrich.schuchardt@canonical.com> | 2025-02-03 10:12:00 +0100 |
---|---|---|
committer | Tom Rini <trini@konsulko.com> | 2025-02-12 12:37:12 -0600 |
commit | 7c7361b98d6eadcbcde556763b6d40a686f4bd3d (patch) | |
tree | 6285735f77c2e1a5ee51b0b60efb868070cb5a33 /include/linux/string.h | |
parent | 10917df17f247d3b0a7f5ca992b97bd2728ef09e (diff) |
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>
Diffstat (limited to 'include/linux/string.h')
-rw-r--r-- | include/linux/string.h | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/include/linux/string.h b/include/linux/string.h index 27b2beb9ddb..d943fcce690 100644 --- a/include/linux/string.h +++ b/include/linux/string.h @@ -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 |