Subject: Re: RFC: memmem(3)
To: None <tech-userlevel@netbsd.org>
From: Christos Zoulas <christos@zoulas.com>
List: tech-userlevel
Date: 03/04/2003 16:05:53
In article <3487.1046772309@munnari.OZ.AU>,
Robert Elz <kre@munnari.OZ.AU> wrote:
>    Date:        Sun, 2 Mar 2003 20:26:03 +1030 (CST)
>    From:        wulf@ping.net.au
>    Message-ID:  <200303020956.h229upW14620@gw.ping.net.au>
>
>  | after many uses I like to propose memmem(3) for inclusion into libc.
>
>Others have commented on the general issues, man page, func signature, ...
>
>so, for me ...

[...]

>For correctness I'd prefer
>		if (b1 == NULL || b2 == NULL || len2 <= 0 || len1 < len2)
>			return NULL;

len1 and len2 are size_t, thus unsigned. the <= test is no different to ==.

[...]

christos