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

Re: svn commit: r9237 - trunk/subversion/libsvn_wc

From: Greg Stein <gstein_at_lyra.org>
Date: 2004-03-31 00:56:15 CEST

On Tue, Mar 30, 2004 at 02:45:15PM -0600, philip@tigris.org wrote:
>...
> +++ trunk/subversion/libsvn_wc/entries.c Tue Mar 30 14:44:44 2004
>...
> err = svn_io_file_read_full (infile, buf, sizeof(buf), &bytes_read, pool);
> if (err && !APR_STATUS_IS_EOF(err->apr_err))
> return err;
> +
> + is_final = (svn_boolean_t) err; /* EOF is only possible error */

Eek! That is one ugly construct there. What happens if svn_boolean_t is
shorter than the err pointer size, and the ptr value ends with 0x0000...
That wouldn't be good.

But more than stupid edge cases, the above construct looks like you're
actually trying to cast the value, rather than test for NULL-ness. Please
(read: -1) change it to something a bit more readable:

  is_final = (err != NULL);

(or lose the parens if you feel so inclined)

Cheers,
-g

-- 
Greg Stein, http://www.lyra.org/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Received on Wed Mar 31 00:55:17 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.