Stefan Sperling <s...@elego.de> writes:

> On Wed, Nov 25, 2009 at 03:51:43PM -0500, Mark Phippard wrote:
>> On Wed, Nov 25, 2009 at 3:27 PM,  <s...@apache.org> wrote:
>> > Author: stsp
>> > Date: Wed Nov 25 20:27:38 2009
>> > New Revision: 884250
>> >
>> > URL: http://svn.apache.org/viewvc?rev=884250&view=rev
>> > Log:
>> > Replace use of strcpy() in libsvn_fs_fs, my compiler keeps complaining.
>> >
>> > * subversion/libsvn_fs_fs/fs_fs.c
>> >  (get_shared_txn): Use strncpy() instead of strcpy(). Make sure to
>> >   NUL-terminate the string in all cases.
>> 
>> Could this use apr_cpystrn?
>> 
>> http://apr.apache.org/docs/apr/0.9/group__apr__strings.html#g69700a825e82dd646f9f166599040431
>
> Oh yes, thanks, that sounds useful.
>
> Looks like I should be making a habit of reading APR header files more
> often :)

Also strncpy does null-padding so the calls using MAX_KEY_SIZE copy
200 bytes every time; that's more than a typical CPU cache line.

-- 
Philip

Reply via email to