* libc/memmem.cc (memmem): Fix bug when searching for empty string.
This commit is contained in:
parent
26b8429317
commit
39962e28d0
@ -1,3 +1,7 @@
|
|||||||
|
2007-12-20 Eric Blake <ebb9@byu.net>
|
||||||
|
|
||||||
|
* libc/memmem.cc (memmem): Fix bug when searching for empty string.
|
||||||
|
|
||||||
2007-12-19 Corinna Vinschen <corinna@vinschen.de>
|
2007-12-19 Corinna Vinschen <corinna@vinschen.de>
|
||||||
|
|
||||||
* cygwin.din: Export wcpcpy, wcpncpy.
|
* cygwin.din: Export wcpcpy, wcpncpy.
|
||||||
|
@ -45,8 +45,8 @@ memmem (const void *l, size_t l_len,
|
|||||||
const char *cs = (const char *)s;
|
const char *cs = (const char *)s;
|
||||||
|
|
||||||
/* we need something to compare */
|
/* we need something to compare */
|
||||||
if (l_len == 0 || s_len == 0)
|
if (s_len == 0)
|
||||||
return NULL;
|
return (void *) l;
|
||||||
|
|
||||||
/* "s" must be smaller or equal to "l" */
|
/* "s" must be smaller or equal to "l" */
|
||||||
if (l_len < s_len)
|
if (l_len < s_len)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user