GNOME Bugzilla – Bug 631242
go_date_days_between_basis problem
Last modified: 2010-10-03 18:14:03 UTC
A minor issue is the comment: * returns : Number of days strictly between from and to +1 in the first switch case if *from==*to 0 is returned so the comment can't be right. Note that the usage of this function depends on 0 being returned for *to==*from ------------------------------------------ The following problem is serious: Breakpoint 1, yearfrac (from=0xbfffdd80, to=0xbfffdd78, basis=GO_BASIS_MSRB_30_360) at gnm-datetime.c:158 158 if (!g_date_valid (from) || !g_date_valid (to)) (gdb) n 161 days = go_date_days_between_basis (from, to, basis); (gdb) 163 if (days < 0) { (gdb) p days $7 = -2 (gdb) p *from $8 = {julian_days = 733831, julian = 1, dmy = 1, day = 28, month = 2, year = 2010} (gdb) p *to $9 = {julian_days = 733831, julian = 1, dmy = 1, day = 28, month = 2, year = 2010} (gdb) c Continuing. Note that *from==*to so the return value ought to be 0 but is -2! This bug underlies the first issue in bug 630784.
This problem has been fixed in the development version. The fix will be available in the next major software release. Thank you for your bug report.