From mboxrd@z Thu Jan 1 00:00:00 1970 X-Msuck: nntp://news.gmane.org/gmane.linux.lib.musl.general/4695 Path: news.gmane.org!not-for-mail From: Szabolcs Nagy Newsgroups: gmane.linux.lib.musl.general Subject: Re: src/string/strstr.c, src/string/wcsstr.c: wrong estimates for MIN(l,63)? Date: Fri, 21 Mar 2014 18:07:45 +0100 Message-ID: <20140321170745.GC27448@port70.net> References: <20140321164817.GJ26358@brightrain.aerifal.cx> Reply-To: musl@lists.openwall.com NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: ger.gmane.org 1395421671 11767 80.91.229.3 (21 Mar 2014 17:07:51 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Fri, 21 Mar 2014 17:07:51 +0000 (UTC) To: musl@lists.openwall.com Original-X-From: musl-return-4699-gllmg-musl=m.gmane.org@lists.openwall.com Fri Mar 21 18:08:00 2014 Return-path: Envelope-to: gllmg-musl@plane.gmane.org Original-Received: from mother.openwall.net ([195.42.179.200]) by plane.gmane.org with smtp (Exim 4.69) (envelope-from ) id 1WR2vG-0005WN-2u for gllmg-musl@plane.gmane.org; Fri, 21 Mar 2014 18:07:58 +0100 Original-Received: (qmail 22259 invoked by uid 550); 21 Mar 2014 17:07:57 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Original-Received: (qmail 22248 invoked from network); 21 Mar 2014 17:07:57 -0000 Content-Disposition: inline In-Reply-To: <20140321164817.GJ26358@brightrain.aerifal.cx> User-Agent: Mutt/1.5.21 (2010-09-15) Xref: news.gmane.org gmane.linux.lib.musl.general:4695 Archived-At: * Rich Felker [2014-03-21 12:48:17 -0400]: > On Fri, Mar 21, 2014 at 03:07:22PM +0100, Yves Bastide wrote: > > /* Fast estimate for MIN(l,63) */ > > size_t grow = l | 63; > > > > "grow" is thus always at least 63... > > If you look at how grow is used on the very next line, this should > make sense. the comment is wrong though z grows by at least max(63,l) unless end-of-string is reached