memmem with NUL length "needle" (aka small) strings on FreeBSD/OSX returns
NULL instead of the "haystack" value (aka big) Submitted by: pho Sponsored by: EMC / Isilon Storage Division
This commit is contained in:
parent
f890b5bffa
commit
362e0ab994
@ -75,8 +75,13 @@ ATF_TC_HEAD(memmem_basic, tc)
|
|||||||
ATF_TC_BODY(memmem_basic, tc)
|
ATF_TC_BODY(memmem_basic, tc)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
#if defined(__darwin__) || defined(__FreeBSD__)
|
||||||
|
expect(memmem(b2, lb2, p0, lp0) == NULL);
|
||||||
|
expect(memmem(b0, lb0, p0, lp0) == NULL);
|
||||||
|
#else
|
||||||
expect(memmem(b2, lb2, p0, lp0) == b2);
|
expect(memmem(b2, lb2, p0, lp0) == b2);
|
||||||
expect(memmem(b0, lb0, p0, lp0) == b0);
|
expect(memmem(b0, lb0, p0, lp0) == b0);
|
||||||
|
#endif
|
||||||
expect(memmem(b0, lb0, p1, lp1) == NULL);
|
expect(memmem(b0, lb0, p1, lp1) == NULL);
|
||||||
expect(memmem(b1, lb1, p1, lp1) == NULL);
|
expect(memmem(b1, lb1, p1, lp1) == NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user