r18578 - gnucash/trunk/src/libqof/qof - Bug #607246: In qof_string_number_compare_func, use base 10 and do not allow octals to sneak in.

Andreas Köhler andi5 at code.gnucash.org
Thu Jan 21 17:52:56 EST 2010


Author: andi5
Date: 2010-01-21 17:52:56 -0500 (Thu, 21 Jan 2010)
New Revision: 18578
Trac: http://svn.gnucash.org/trac/changeset/18578

Modified:
   gnucash/trunk/src/libqof/qof/qofquerycore.c
Log:
Bug #607246: In qof_string_number_compare_func, use base 10 and do not allow octals to sneak in.

Otherwise, transaction number 0108 (octal 010=8) will sort before 0107 (octal 0107=71).

Modified: gnucash/trunk/src/libqof/qof/qofquerycore.c
===================================================================
--- gnucash/trunk/src/libqof/qof/qofquerycore.c	2010-01-21 22:13:09 UTC (rev 18577)
+++ gnucash/trunk/src/libqof/qof/qofquerycore.c	2010-01-21 22:52:56 UTC (rev 18578)
@@ -207,8 +207,8 @@
     if (s1 && !s2) return 1;
 
     // Convert to integers and test
-    i1 = strtol(s1, &sr1, 0);
-    i2 = strtol(s2, &sr2, 0);
+    i1 = strtol(s1, &sr1, 10);
+    i2 = strtol(s2, &sr2, 10);
     if (i1 < i2)  return -1;
     if (i1 > i2)  return 1;
 



More information about the gnucash-changes mailing list