More on Crash in QIF importer (1.6.4)

Steve Murphy murf@e-tools.com
05 Dec 2001 09:25:33 -0700


--=-eImJBxVBPqx/K4P8q2O/
Content-Type: text/plain
Content-Transfer-Encoding: quoted-printable


OK, I got a little obsessed on that crash I reported yesterday.

So, I tried a few things.

One: if I don't make any changes to the commodity entries when I import,
no crash.

Two: If I only change the stock exchange from NYSE to NASDAQ, no crash.

Three: If I change the 3rd entry (the ticker code) THEN I crash.=20

Also, in trying to figure out why, I came across this code:

src/engine/gnc-numeric.c:


double
gnc_numeric_to_double(gnc_numeric in) {
  if(in.denom >=3D 0) {
    return (double)in.num/(double)in.denom;
  }
  else {
    return (double)(in.num * in.denom);
  }
}

Now, if the in.denom is zero, do you REALLY and to divide by it? I
advise changing the test if(in.denom >=3D 0) to be if(in.denom > 0), or
restructuring the code. What are the semantics of the
numerator/denominator pair?

I changed this, but I still crash. I think the balance of 17/0 is what's
the problem. Why it's 17/0 when I change a ticker code, I have no idea.
What it is if I DON'T change the fields, I don't know.

I haven't noticed any response to the crash report... is a tree falling,
alone, in the forest?

murf


--=-eImJBxVBPqx/K4P8q2O/
Content-Type: application/pgp-signature; name=signature.asc

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQA8Dkp96/5EwE4UaOQRAhGsAJ40IwBwm0GAfjNB1FTiZfK4qkZwQgCcDouQ
tf9EGxiZr+eAZ5wE/SfMJ7E=
=Zppw
-----END PGP SIGNATURE-----

--=-eImJBxVBPqx/K4P8q2O/--