Re: [PATCH 4/7] lib: Introduce strnstr()

Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
From: Steven Rostedt
Date: Monday, January 18, 2010 - 7:53 am

On Sat, 2010-01-16 at 12:12 +0100, Alex Riesen wrote:

Actually it is related. Making both strstr and strnstr use the correct
variable and be consistent. This patch introduces strnstr and in doing
so also makes strstr consistent (and correct) with strnstr.


The first check is len-1, I don't see it searching past the
NUL-terminator. The loop will stop when l1 == l2 (the size of s2) and s1
pointing near the end of the string.

-- Steve



--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[PATCH 4/7] lib: Introduce strnstr(), Li Zefan, (Wed Jan 13, 7:53 pm)
[tip:tracing/urgent] ftrace: Fix MATCH_END_ONLY function f ..., tip-bot for Li Zefan, (Sat Jan 16, 2:42 am)
[tip:tracing/urgent] tracing/filters: Fix MATCH_FRONT_ONLY ..., tip-bot for Li Zefan, (Sat Jan 16, 2:43 am)
[tip:tracing/urgent] tracing/filters: Fix MATCH_END_ONLY f ..., tip-bot for Li Zefan, (Sat Jan 16, 2:43 am)
[tip:tracing/urgent] lib: Introduce strnstr(), tip-bot for Li Zefan, (Sat Jan 16, 2:43 am)
[tip:tracing/urgent] tracing/filters: Fix MATCH_MIDDLE_ONL ..., tip-bot for Li Zefan, (Sat Jan 16, 2:43 am)
[tip:tracing/urgent] tracing/filters: Fix MATCH_FULL filte ..., tip-bot for Li Zefan, (Sat Jan 16, 2:44 am)
[tip:tracing/urgent] tracing/filters: Add comment for matc ..., tip-bot for Li Zefan, (Sat Jan 16, 2:44 am)
Re: [PATCH 4/7] lib: Introduce strnstr(), Alex Riesen, (Sat Jan 16, 4:12 am)
Re: [PATCH 4/7] lib: Introduce strnstr(), Steven Rostedt, (Mon Jan 18, 7:53 am)
Re: [PATCH 4/7] lib: Introduce strnstr(), Alex Riesen, (Mon Jan 18, 8:56 am)