[Asterisk-Dev] [RFC] strncpy -> ast_copy_string

Ledion B tekixhunga at yahoo.com
Mon May 2 10:42:44 MST 2005


> >n will _always_ be greater than strlen(src), at
least
> >99.99% of the cases. We are copying strings into 
> >fixed-size buffers that always have enough room.
> 
> I was worrying about this being the case. So I did a
> real quick scan through the *'s code and yes indeed
> that is the case, that most of the time strncpy is
> called with the size of the destination buffer. 

>That is the whole purpose of the third argument to
>strncpy() !!!

What about copying substrings? I thought this was the
most used case, I can be wrong too. But what the heck,
you can do both, even better :-}

__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 



More information about the asterisk-dev mailing list