aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/include/linux/string.h
diff options
context:
space:
mode:
authorLi Zefan <lizf@cn.fujitsu.com>2010-01-14 10:53:55 +0800
committerSteven Rostedt <rostedt@goodmis.org>2010-01-14 22:38:09 -0500
commitd5f1fb53353edc38da326445267c1df0c9676df2 (patch)
tree42def644ebd0d343f2eba9e625f4b9b1ea8a36f0 /include/linux/string.h
parenttracing/filters: Fix MATCH_END_ONLY filter matching (diff)
downloadwireguard-linux-d5f1fb53353edc38da326445267c1df0c9676df2.tar.xz
wireguard-linux-d5f1fb53353edc38da326445267c1df0c9676df2.zip
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>
Diffstat (limited to 'include/linux/string.h')
-rw-r--r--include/linux/string.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/linux/string.h b/include/linux/string.h
index 651839a2a755..a716ee2a8adb 100644
--- a/include/linux/string.h
+++ b/include/linux/string.h
@@ -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 *);