Index: ChangeLog
===================================================================
--- ChangeLog	(revision 4652)
+++ ChangeLog	(working copy)
@@ -5,6 +5,14 @@
 $Id$
 $URL$
 
+2010-03-31 Frank Weber <opionline@yahoo.de>
+
+  * YAM_COs.c: Initialize co->BirthdayCheckTime.ds_Days before calling
+    String2DateStamp() or DateStamp2String() because otherwise the functions
+    return unexpected results. This closes #145.
+  * YAM_AB.c: Do the birthday compare only if here is really anthing to compare.
+    Use the saved BirthdayCheckTime seconds (ticks) for the next check too.
+
 2010-03-25 Frank Weber <opionline@yahoo.de>
 
   * YAM_COg.c, YAM_FI.c, YAM_main.h, YAM_stringsizes.h, locale/YAM.cd:
Index: src/YAM_AB.c
===================================================================
--- src/YAM_AB.c	(revision 4652)
+++ src/YAM_AB.c	(working copy)
@@ -515,7 +515,7 @@
     {
       struct ABEntry *ab = tn->tn_User;
 
-      if(ab->Type == AET_USER)
+      if(ab->Type == AET_USER && ab->BirthDay != 0)
       {
         ldiv_t birthday = ldiv(ab->BirthDay, 10000);
 
@@ -538,7 +538,6 @@
           }
         }
       }
-
       i++;
     }
   }
@@ -546,7 +545,7 @@
   // reschedule the birthday check for the configured check time
   DateStamp(&nextDS);
   nextDS.ds_Minute = C->BirthdayCheckTime.ds_Minute;
-  nextDS.ds_Tick = 0;
+  nextDS.ds_Tick = C->BirthdayCheckTime.ds_Tick;
 
   DateStamp2TimeVal(&nextDS, &nextTV, TZC_NONE);
 
Index: src/YAM_COs.c
===================================================================
--- src/YAM_COs.c	(revision 4652)
+++ src/YAM_COs.c	(working copy)
@@ -653,6 +653,7 @@
     fprintf(fh, "AutoClip         = %s\n", Bool2Txt(co->AutoClip));
     fprintf(fh, "ShowFilterStats  = %s\n", Bool2Txt(co->ShowFilterStats));
 
+    co->BirthdayCheckTime.ds_Days=0;
     DateStamp2String(buf, sizeof(buf), &co->BirthdayCheckTime, DSS_TIME, TZC_NONE);
     fprintf(fh, "BirthdayCheckTime= %s\n", buf);
 
@@ -1541,7 +1542,8 @@
           else if(stricmp(buf, "ShowFilterStats") == 0)   co->ShowFilterStats = Txt2Bool(value);
           else if(stricmp(buf, "BirthdayCheckTime") == 0)
           {
-             String2DateStamp(&co->BirthdayCheckTime, value, DSS_TIME, TZC_NONE);
+            co->BirthdayCheckTime.ds_Days=0;
+            String2DateStamp(&co->BirthdayCheckTime, value, DSS_TIME, TZC_NONE);
           }
           else
             W(DBF_CONFIG, "unknown config option: '%s' = '%s'", buf, value);
