lib: Introduce strnstr()
It differs strstr() in that it limits the length to be searched in the first string. Signed-off-by: Li Zefan <lizf@cn.fujitsu.com> LKML-Reference: <4B4E8743.6030805@cn.fujitsu.com> Acked-by: Frederic Weisbecker <fweisbec@gmail.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
This commit is contained in:
@ -72,7 +72,10 @@ static inline __must_check char *strstrip(char *str)
|
||||
}
|
||||
|
||||
#ifndef __HAVE_ARCH_STRSTR
|
||||
extern char * strstr(const char *,const char *);
|
||||
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 *);
|
||||
|
Reference in New Issue
Block a user