Re: Re: [Kmymoney2-user] ofx

Benoit Grégoire <[email protected]> Sun, 25 Sep 2005 16:33:32 -0400
Newsgroups gmane.comp.finance.libofx.devel
Organization Technologie Coeus
Message-ID <[email protected]>
On September 25, 2005 03:53 pm, ace jones wrote:
> On Sat, 2005-09-24 at 22:15, ace jones wrote:
> > On Sat, 2005-09-24 at 21:04, Benoit Grégoire wrote:
> > > tree.hh is software maintained by http://www.aei.mpg.de/~peekas/tree/. 
> > > We should look if there is an update, I don't mind udating it, but I'd
> > > like to avoid patching it in libofx.
> >
> > I tried bringing in the latest tree.hh.  Unfortunately, the first file I
> > tested ofxdump on hung in tree.hh!!  The backtrace is below.  This is an
> > integer underflow problem.  operator+=(unsigned) is getting passed a
> > bogus value, which is (unsigned)(-2), because add_container gets the
> > number_of_siblings and subtracts 2.  In this case there are 0 siblings,
> > so -2 gets sent in.
>
> Ok, I had a chance to look more closely at this.  It looks like the old
> tree.hh had a bug where the number_of_siblings was overstated by 2.
> This code probably just adjusted it (although a comment to that effect
> would have been handy :) ).

Sorry about that, it's probably my fault.  I remember casing strange problems  
with sibblings being skipped.

> Removing the -2's makes ofxdump work without error on the OFX data I've
> tested it with, so I think it's good.  I'll check in the changes after a
> little more testing.

Just count the number of transactions in your file, nad check that ofxdump 
returns the same amount.  If so, go ahead and commit.  

-- 
Benoit Grégoire, http://benoitg.coeus.ca/
signature.asc (application/pgp-signature, 189 B)
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.0 (GNU/Linux)

iD8DBQBDNwmdmZ6zzPlLuwMRAkZdAKCF5XLMYN+yofsf6CaZAgzXowvFOQCfWFSU
4dO8pAgZ9GeDP9/slegWz5Q=
=6R2U
-----END PGP SIGNATURE-----