[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: svn commit: r34627 - in trunk/subversion: include libsvn_client libsvn_fs_base/util libsvn_subr libsvn_wc

From: Greg Stein <gstein_at_gmail.com>
Date: Tue, 9 Dec 2008 15:27:52 -0800

On Tue, Dec 9, 2008 at 10:01, Hyrum K. Wright <hyrum_at_hyrumwright.org> wrote:
>...
> +++ trunk/subversion/libsvn_subr/checksum.c Tue Dec 9 10:01:12 2008 (r34627)
> @@ -69,13 +69,13 @@ svn_checksum_create(svn_checksum_kind_t
> }
>
> svn_checksum_t *
> -svn_checksum__from_md5_digest(const unsigned char *digest,
> - apr_pool_t *result_pool)
> +svn_checksum__from_digest(const unsigned char *digest,
> + svn_checksum_kind_t kind,
> + apr_pool_t *result_pool)
> {
> - svn_checksum_t *checksum = svn_checksum_create(svn_checksum_md5,
> - result_pool);
> + svn_checksum_t *checksum = svn_checksum_create(kind, result_pool);
>
> - memcpy((unsigned char *)checksum->digest, digest, APR_MD5_DIGESTSIZE);
> + checksum->digest = apr_pmemdup(result_pool, digest, DIGESTSIZE(kind));

I'd suggest the original memcpy() rather than allocating more memory.

Cheers,
-g

------------------------------------------------------
http://subversion.tigris.org/ds/viewMessage.do?dsForumId=462&dsMessageId=981911
Received on 2008-12-10 00:28:07 CET

This is an archived mail posted to the Subversion Dev mailing list.