From owner-freebsd-audit Wed Oct 10 18: 2: 6 2001 Delivered-To: freebsd-audit@freebsd.org Received: from coffee.q9media.com (coffee.q9media.com [216.94.229.19]) by hub.freebsd.org (Postfix) with ESMTP id EF1D937B406 for ; Wed, 10 Oct 2001 18:02:03 -0700 (PDT) Received: (from mike@localhost) by coffee.q9media.com (8.11.6/8.11.6) id f9B126T52790; Wed, 10 Oct 2001 21:02:06 -0400 (EDT) (envelope-from mike) Date: Wed, 10 Oct 2001 21:02:06 -0400 From: Mike Barcroft To: "Andrew L. Neporada" Cc: audit@FreeBSD.ORG Subject: Re: strnstr(3) - New libc function for review Message-ID: <20011010210206.G49828@coffee.q9media.com> References: <20011010115210.E49828@coffee.q9media.com> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: ; from andrew@nas.dgap.mipt.ru on Wed, Oct 10, 2001 at 08:16:27PM +0400 Organization: The FreeBSD Project Sender: owner-freebsd-audit@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG Andrew L. Neporada writes: > On Wed, 10 Oct 2001, Mike Barcroft wrote: > > No, that's inconsistent with existing strn...() functions and totally > > defeats the purpose of my addition. > > Check attached test program. It prints "NULL". So either implementation or > man page is wrong. Yes, that's a documentation problem. I'll correct it today. strncmp(3) has a similar problem; I'll correct that as well. > > > P.P.S. In the case of binary strings it is possible to implement faster > > > search -- see attachment. > > > > Yes. > > Could you please comment my bstrstr implementation? I don't really understand the context. Are you proposing I use it instead of strnstr(3)? If so, that's not what strnstr(3) is intended to do; it's designed for strings only. Best regards, Mike Barcroft To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-audit" in the body of the message