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

Re: svn commit: r9321 - trunk/subversion/libsvn_fs_fs

From: Garrett Rooney <rooneg_at_electricjellyfish.net>
Date: 2004-04-11 19:20:34 CEST

On Apr 11, 2004, at 12:05 PM, jpieper@tigris.org wrote:

> +/* Read a text representation of an apr_hash from STREAM into the hash
> + object HASH. Allocations are from POOL. This is copied directly
> + from svn_hash_read, with file reads replaced by stream reads. */
> +static svn_error_t *
> +hash_read (apr_hash_t *hash,
> + svn_stream_t *stream,
> + apr_pool_t *pool)
> +{
> + svn_error_t *err;
> + svn_stringbuf_t *stringbuf;
> + svn_boolean_t eof;
> + char buf[SVN_KEYLINE_MAXLEN];
> + apr_size_t num_read;
> + char c;
> + int first_time = 1;
> +
> +
> + while (1)
> + {
> + /* Read a key length line. Might be END, though. */
> + apr_size_t len = sizeof (buf);
> +
> + SVN_ERR (svn_stream_readline (stream, &stringbuf, "\n", &eof,
> pool));
> + if (eof)
> + {
> + /* We got an EOF on our very first attempt to read, which
> + means it's a zero-byte file. No problem, just go home.
> */
> + svn_error_clear (err);
> + return SVN_NO_ERROR;

Any specific reason for clearing the error here? As far as I can tell
if svn_stream_readline had returned an error you'd already have exited
the function, so err is probably uninitialized here...

-garrett

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Sun Apr 11 19:21:56 2004

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

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.