r1709 - trunk/src/target/OM-2007/applications/openmoko-rssreader/src

zecke at sita.openmoko.org zecke at sita.openmoko.org
Sun Apr 8 02:23:58 CEST 2007


Author: zecke
Date: 2007-04-08 02:23:57 +0200 (Sun, 08 Apr 2007)
New Revision: 1709

Modified:
   trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
Log:
openmoko-rssreader: There is still something wrong with formating dates
    Somehow I get funny dates such as 29th of February or 31st of
    April. I don't know where they come from, this somehow looks like
    a off by one in month name calculation. This might come from mrss
    and the atom->RSS date conversion.


Modified: trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c
===================================================================
--- trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c	2007-04-07 23:16:08 UTC (rev 1708)
+++ trunk/src/target/OM-2007/applications/openmoko-rssreader/src/rfcdate.c	2007-04-08 00:23:57 UTC (rev 1709)
@@ -187,6 +187,21 @@
     self->timeval.tv_sec  = hour*60*60 + minute*60 + second;
     self->timeval.tv_usec = 0;
     g_date_set_dmy ( self->date, day, rss_month_number (month_name), year);
+
+
+    /*
+     * broken software? The 29th February and 31st April simply doesn't exist
+     * What should we do with these dates? round to the nearest legal date?
+     */
+    if ( !g_date_valid (self->date) ) {
+        g_print ("Setting RFC Date failed: '%s' %d %d %s %d  %ld\n",
+                        rfc822date,
+                        day,
+                        rss_month_number(month_name),
+                        month_name,
+                        year,
+                        self->timeval.tv_sec);
+    }
 }
 
 /*





More information about the commitlog mailing list