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/

Reply via email to