You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by Ben Reser <be...@reser.org> on 2004/02/29 19:00:45 UTC

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

[[[
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.

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

]]]

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

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

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

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

Posted by Branko Cibej <br...@xbc.nu>.
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 Greg Hudson <gh...@MIT.EDU>.
Committed in r8871.  Thanks.


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