httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From r..@apache.org
Subject Re: cvs commit: apache-2.0/src/lib/apr/locks/unix crossproc.c
Date Thu, 16 Mar 2000 22:16:41 GMT

Okay, my mistake.  I'll fix it in a few minutes.

Ryan

On Thu, 16 Mar 2000, Jim Jagielski wrote:

> rbb@apache.org wrote:
> > 
> > > Why use ap_cpystrn() and pass strlen(fname) ? Shouldn't this simply be:
> > > 
> > >    strcpy(new->fname, fname)
> > > 
> > > ??
> > > 
> > 
> > I thought we always used ap_cpystrn, because it gives us a simple
> > interface that is consistent across all platforms.  If I'm worng, we can
> > go ahead and change it.
> > 
> 
> Why?? From the file itself :)
> 
> /*
>  * Apache's "replacement" for the strncpy() function. We roll our
>  * own to implement these specific changes:
>  *   (1) strncpy() doesn't always null terminate and we want it to.
>  *   (2) strncpy() null fills, which is bogus, esp. when copy 8byte
>  *       strings into 8k blocks.
>  *   (3) Instead of returning the pointer to the beginning of
>  *       the destination string, we return a pointer to the
>  *       terminating '\0' to allow us to "check" for truncation
>  *
>  * ap_cpystrn() follows the same call structure as strncpy().
>  */
> 
> 
> -- 
> ===========================================================================
>    Jim Jagielski   [|]   jim@jaguNET.com   [|]   http://www.jaguNET.com/
>                 "Are you suggesting coconuts migrate??"
> 


_______________________________________________________________________________
Ryan Bloom                        	rbb@apache.org
406 29th St.
San Francisco, CA 94131
-------------------------------------------------------------------------------


Mime
View raw message