Doug MacEachern <[EMAIL PROTECTED]> writes:
> > More importantly, I think your patch is broken. Likely I'm confused,
> > but I don't see how the terminating '\0' gets added in your patch.
> > strncpy() will bail out before adding '\0' since it has exhausted the
> > len bytes it thinks are available in the buffer pointed to by cp.
>
> no, the result string is terminated before going into the loop:
> /* Allocate the required string */
>
> res = (char *) apr_palloc(a, len + 1);
> cp = res;
> *cp = '\0';
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.
--
Jeff Trawick | [EMAIL PROTECTED] | PGP public key at web site:
http://www.geocities.com/SiliconValley/Park/9289/
Born in Roswell... married an alien...