--- src/elogd.orig	2005-06-15 16:48:31.000000000 +0200
+++ src/elogd.c	2005-06-15 17:16:48.000000000 +0200
@@ -1532,7 +1532,7 @@
 void show_error(char *error);
 BOOL enum_user_line(LOGBOOK * lbs, int n, char *user, int size);
 int get_user_line(LOGBOOK * lbs, char *user, char *password, char *full_name,
-                  char *email, BOOL email_notify[1000], int *last_access);
+                  char *email, BOOL email_notify[1000], time_t *last_access);
 int strbreak(char *str, char list[][NAME_LENGTH], int size, char *brk);
 int execute_shell(LOGBOOK * lbs, int message_id, char attrib[MAX_N_ATTR][NAME_LENGTH],
                   char att_file[MAX_ATTACHMENTS][256], char *sh_cmd);
@@ -1675,6 +1675,11 @@
    return TRUE;
 }
 
+/* workaroud for some gcc versions bug for "%c" format (see strftime(3) */
+size_t my_strftime(char *s, size_t max, const char *fmt, const struct tm *tm) 
+{
+   return strftime(s, max, fmt, tm);
+}
 /*---- Safe malloc wrappers with out of memory checking from GNU ---*/
 
 static void memory_error_and_abort(char *func)
@@ -8052,7 +8057,7 @@
                if (!getcfg(lbs->name, "Date format", format, sizeof(format)))
                   strcpy(format, DEFAULT_DATE_FORMAT);
 
-               strftime(value[i], NAME_LENGTH, format, ts);
+               my_strftime(value[i], NAME_LENGTH, format, ts);
 
             } else
                strcpy(value[i], attrib[i]);
@@ -8091,7 +8096,7 @@
       if (!getcfg(lbs->name, "Time format", format, sizeof(format)))
          strcpy(format, DEFAULT_TIME_FORMAT);
 
-      strftime(str, sizeof(str), format, ts);
+      my_strftime(str, sizeof(str), format, ts);
    } else
       sprintf(str, "%d", (int) t);
    strcpy(value[i++], str);
@@ -8104,7 +8109,7 @@
       if (!getcfg(lbs->name, "Time format", format, sizeof(format)))
          strcpy(format, DEFAULT_TIME_FORMAT);
 
-      strftime(str, sizeof(str), format, ts);
+      my_strftime(str, sizeof(str), format, ts);
    } else
       sprintf(str, "%d", (int) t);
    strcpy(value[i++], str);
@@ -8131,7 +8136,7 @@
       strcpy(format, DEFAULT_TIME_FORMAT);
    ltime = date_to_ltime(date);
    pts = localtime(&ltime);
-   strftime(str, sizeof(str), format, pts);
+   my_strftime(str, sizeof(str), format, pts);
 
    add_subst_list(list, value, item, str, i);
 }
@@ -9273,10 +9278,10 @@
 
       ltime = date_to_ltime(date);
       pts = localtime(&ltime);
-      strftime(str, sizeof(str), format, pts);
+      my_strftime(str, sizeof(str), format, pts);
    } else {
       if (getcfg(lbs->name, "Time format", format, sizeof(format)))
-         strftime(str, sizeof(str), format, localtime(&now));
+         my_strftime(str, sizeof(str), format, localtime(&now));
       else
          strcpy(str, ctime(&now));
       strcpy(date, ctime(&now));
@@ -9392,7 +9397,7 @@
             if (ltime == 0)
                strcpy(str, "-");
             else
-               strftime(str, sizeof(str), format, pts);
+               my_strftime(str, sizeof(str), format, pts);
 
          } else
             strlcpy(str, attrib[index], sizeof(str));
@@ -14903,7 +14908,7 @@
 
             ltime = date_to_ltime(date);
             pts = localtime(&ltime);
-            strftime(str, sizeof(str), format, pts);
+            my_strftime(str, sizeof(str), format, pts);
 
             if (strieq(mode, "Threaded")) {
                if (skip_comma) {
@@ -14976,7 +14981,7 @@
                      if (ltime == 0)
                         strcpy(str, "-");
                      else
-                        strftime(str, sizeof(str), format, pts);
+                        my_strftime(str, sizeof(str), format, pts);
 
                      if (disp_attr_link == NULL || disp_attr_link[index])
                         rsprintf("<td class=\"%s\"><a href=\"%s\">%s</a></td>\n", sclass, ref, str);
@@ -14994,7 +14999,7 @@
                      if (ltime == 0)
                         strcpy(str, "-");
                      else
-                        strftime(str, sizeof(str), format, pts);
+                        my_strftime(str, sizeof(str), format, pts);
 
                      if (disp_attr_link == NULL || disp_attr_link[index])
                         rsprintf("<td class=\"%s\"><a href=\"%s\">%s</a></td>\n", sclass, ref, str);
@@ -17283,7 +17288,7 @@
          rsprintf("<table width=\"100%%\" border=0 cellpadding=0 cellspacing=0>\n");
          rsprintf("<tr><td nowrap width=\"10%%\" class=\"attribname\">%s:</td>", loc("New entries since"));
          memcpy(&tms, localtime(&ltime_start), sizeof(struct tm));
-         strftime(str, sizeof(str), "%c", &tms);
+         my_strftime(str, sizeof(str), "%c", &tms);
          rsprintf("<td class=\"attribvalue\">%s</td></tr>", str);
          rsprintf("</table></td></tr>\n\n");
       }
@@ -17345,7 +17350,7 @@
                         strcpy(format, DEFAULT_DATE_FORMAT);
                      else
                         strcpy(format, DEFAULT_TIME_FORMAT);
-                     strftime(str, sizeof(str), format, &tms);
+                     my_strftime(str, sizeof(str), format, &tms);
                      if (ltime2 > 0)
                         rsprintf("%s %s", loc("From"), str);
                      else
@@ -17357,7 +17362,7 @@
                         strcpy(format, DEFAULT_DATE_FORMAT);
                      else
                         strcpy(format, DEFAULT_TIME_FORMAT);
-                     strftime(str, sizeof(str), format, &tms);
+                     my_strftime(str, sizeof(str), format, &tms);
                      if (ltime1 > 0)
                         rsprintf(" %s %s", loc("to"), str);
                      else
@@ -17866,7 +17871,7 @@
                   char attrib[MAX_N_ATTR][NAME_LENGTH], char *mail_param, int old_mail,
                   char att_file[MAX_ATTACHMENTS][256], char *encoding)
 {
-   int i, j, k, n, flags, status, html;
+   int i, j, k, n, flags, status, html=0;
    char str[NAME_LENGTH + 100], str2[256], mail_from[256], *mail_text, smtp_host[256],
        subject[256], format[256], error[256], content_type[256];
    char slist[MAX_N_ATTR + 10][NAME_LENGTH], svalue[MAX_N_ATTR + 10][NAME_LENGTH];
@@ -17922,12 +17927,13 @@
    if (html)
       sprintf(mail_text + strlen(mail_text), "<table border=\"3\" cellpadding=\"4\">\r\n");
 
-   if (flags & 32)
+   if (flags & 32) {
       if (html) {
          sprintf(mail_text + strlen(mail_text), "<tr><td bgcolor=\"#CCCCFF\">%s URL</td>", loc("Logbook"));
          sprintf(mail_text + strlen(mail_text), "<td bgcolor=\"#DDEEBB\">%s</td></tr>\r\n", lbs->name);
-      } else
+      } else 
          sprintf(mail_text + strlen(mail_text), "%s             : %s\r\n", loc("Logbook"), lbs->name);
+   }
 
    if (flags & 2) {
       for (j = 0; j < lbs->n_attr; j++) {
@@ -17950,7 +17956,7 @@
             if (ltime == 0)
                strcpy(comment, "-");
             else
-               strftime(comment, sizeof(str), format, pts);
+               my_strftime(comment, sizeof(str), format, pts);
          } else if (attr_flags[j] & AF_DATETIME) {
 
             if (!getcfg(lbs->name, "Time format", format, sizeof(format)))
@@ -17961,7 +17967,7 @@
             if (ltime == 0)
                strcpy(comment, "-");
             else
-               strftime(comment, sizeof(str), format, pts);
+               my_strftime(comment, sizeof(str), format, pts);
          }
 
          if (!comment[0])
@@ -19593,7 +19599,7 @@
 
       ltime = date_to_ltime(date);
       pts = localtime(&ltime);
-      strftime(str, sizeof(str), format, pts);
+      my_strftime(str, sizeof(str), format, pts);
 
       rsprintf("&nbsp;&nbsp;&nbsp;&nbsp;%s:&nbsp;<b>%s</b>\n", loc("Entry time"), str);
 
@@ -19743,7 +19749,7 @@
             if (ltime == 0)
                strcpy(str, "-");
             else
-               strftime(str, sizeof(str), format, pts);
+               my_strftime(str, sizeof(str), format, pts);
 
             rsprintf("%s:</td><td class=\"%s\">%s&nbsp</td>\n", attr_list[i], class_value, str);
 
@@ -19757,7 +19763,7 @@
             if (ltime == 0)
                strcpy(str, "-");
             else
-               strftime(str, sizeof(str), format, pts);
+               my_strftime(str, sizeof(str), format, pts);
 
             rsprintf("%s:</td><td class=\"%s\">%s&nbsp</td>\n", attr_list[i], class_value, str);
 
@@ -20317,7 +20323,7 @@
 /*------------------------------------------------------------------*/
 
 int get_user_line(LOGBOOK * lbs, char *user, char *password, char *full_name,
-                  char *email, BOOL email_notify[1000], int *last_logout)
+                  char *email, BOOL email_notify[1000], time_t *last_logout)
 {
    int i, j;
    char str[256], global[256], orig_topgroup[256];
