r20177 - gnucash/trunk/src/backend - Change serialization of doubles in the dbi backend to use

Phil Longstaff plongstaff at rogers.com
Thu Jan 27 14:49:45 EST 2011


Isn't "g_strdup_printf( "%s", doublestr )" (line 2799) just the same as 
"g_strdup( doublestr)" without the need for the printf?

 Phil
---------
I used to be a hypochondriac AND a kleptomaniac. So I took something for it.




________________________________
From: John Ralls <jralls at code.gnucash.org>
To: gnucash-patches at gnucash.org
Sent: Thu, January 27, 2011 2:38:40 PM
Subject: r20177 - gnucash/trunk/src/backend - Change serialization of doubles in 
the dbi backend to use 


Author: jralls
Date: 2011-01-27 14:38:39 -0500 (Thu, 27 Jan 2011)
New Revision: 20177
Trac: http://svn.gnucash.org/trac/changeset/20177

Modified:
   gnucash/trunk/src/backend/dbi/gnc-backend-dbi.c
   gnucash/trunk/src/backend/sql/gnc-backend-sql.c
Log:
Change serialization of doubles in the dbi backend to use 
g_ascii_dtostr() instead of sprintf. 

The problem is that sprintf is subject to localization and will output 
e.g. 1,25 for one-and-a-quarter in European locales. SQL doesn't support 
localization, so will interpret 1,25 as two fields, 1 and 25.

Note also that GUID_ENCODING_LENGTH isn't big enough for a double, so 
that's changed to G_ASCII_DTOSTR_BUF_SIZE.



_______________________________________________
gnucash-patches mailing list
gnucash-patches at gnucash.org
https://lists.gnucash.org/mailman/listinfo/gnucash-patches


More information about the gnucash-devel mailing list