You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Branko Cibej <br...@xbc.nu> on 2004/03/02 10:54:12 UTC

Re: [PATCH] Fix format of strlen() data in the new transactionless reporter.

Quoting Ben Reser <be...@reser.org>:

> [[[
> strlen returns size_t which can be a long on some platforms.  So using
> %d as the format is wrong.  Use APR_SIZE_T_FMT instead.  On all
> platforms apr_size_t is just a size_t so the format should be correct.

(And on platforms that don#t have size_t -- if any such still 
exist -- I'd consider it a bug if APR chose anything but 'int'
for apr_size_t...)

> * subversion/libsvn_repos/reporter.c
>   (write_path_info): Use the correct format for the size_t returned from
>     strlen.
> 
> ]]]

+1.

BTW, Is this the only place in our code where we strlen in a printf?

-- Brane

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org

Re: [PATCH] Fix format of strlen() data in the new transactionless reporter.

Posted by Ben Reser <be...@reser.org>.
On Tue, Mar 02, 2004 at 11:54:12AM +0100, Branko Cibej wrote:
> (And on platforms that don#t have size_t -- if any such still 
> exist -- I'd consider it a bug if APR chose anything but 'int'
> for apr_size_t...)

apr_int32_t

> BTW, Is this the only place in our code where we strlen in a printf?

Looks like libsvn_ra_svn in marshal.c had one too that was already
handled this way.  There might be others.  But they either have %ld or
they're doing this already.  It was spitting out a warning on LP64.

-- 
Ben Reser <be...@reser.org>
http://ben.reser.org

"Conscience is the inner voice which warns us somebody may be looking."
- H.L. Mencken

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org