Return-Path: Delivered-To: apmail-apr-dev-archive@apr.apache.org Received: (qmail 71274 invoked by uid 500); 20 Jun 2001 14:45:54 -0000 Mailing-List: contact dev-help@apr.apache.org; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: Delivered-To: mailing list dev@apr.apache.org Received: (qmail 70924 invoked from network); 20 Jun 2001 14:45:49 -0000 Sender: ben@top.ben.algroup.co.uk Message-ID: <3B30C412.599119C8@algroup.co.uk> Date: Wed, 20 Jun 2001 16:41:06 +0100 From: Ben Laurie X-Mailer: Mozilla 4.51 [en] (X11; I; FreeBSD 4.1.1-STABLE-20001015 i386) X-Accept-Language: en MIME-Version: 1.0 To: Doug MacEachern CC: Jeff Trawick , dev@apr.apache.org Subject: Re: apr_strcat optimization(s) References: Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Spam-Rating: h31.sny.collab.net 1.6.2 0/1000/N Doug MacEachern wrote: > > On 19 Jun 2001, Jeff Trawick wrote: > > > cp doesn't point to the end of the string to be built yet. If you had > > > > *(cp + len) = '\0'; > > > > then I'd believe you. > > oh right, here is the current patch.. > > --- srclib/apr/strings/apr_strings.c 2001/05/10 18:05:18 1.13 > +++ srclib/apr/strings/apr_strings.c 2001/06/19 18:22:53 > @@ -130,15 +130,16 @@ > > res = (char *) apr_palloc(a, len + 1); > cp = res; > - *cp = '\0'; > + *(cp + len) = '\0'; Err, cp[len]='\0', perlease! Its probably worth a fraction of a microsecond (or more) to put this at the end, btw. Cheers, Ben. -- http://www.apache-ssl.org/ben.html In SF until 21st April - http://ApacheCon.com/