]> git.sur5r.net Git - bacula/bacula/commitdiff
Correct src/lib/var.c for Alpha machine
authorKern Sibbald <kern@sibbald.com>
Sun, 11 Jan 2004 14:04:01 +0000 (14:04 +0000)
committerKern Sibbald <kern@sibbald.com>
Sun, 11 Jan 2004 14:04:01 +0000 (14:04 +0000)
git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@1002 91ce42f0-d328-0410-95d8-f526ca767f89

bacula/src/lib/var.c
bacula/src/tools/bsmtp.c

index 8022a0ab4ef1ebc22af956e10bc21a8dd98f5e7d..ffdbc5c8327fb9fbcfe78c95a5a06da698fdb1f3 100644 (file)
@@ -120,7 +120,7 @@ var_mvxprintf(
     int n;
     int bytes;
 
-    if (format == NULL || ap == NULL)
+    if (format == NULL)
        return -1;
     bytes = 0;
     while (*format != '\0') {
@@ -204,7 +204,7 @@ var_mvsnprintf(
     int n;
     var_mvsnprintf_cb_t ctx;
 
-    if (format == NULL || ap == NULL)
+    if (format == NULL)
        return -1;
     if (buffer != NULL && bufsize == 0)
        return -1;
index f8fa4bf5d34add1cf459d9068dc2e64c264fd669..3c5eba25a1e364290a9d0d39911fc4f95fd943ef 100644 (file)
@@ -127,6 +127,8 @@ int main (int argc, char *argv[])
     int s, r, i, ch;
     struct passwd *pwd;
     char *cp, *p;
+    time_t now = time(NULL);
+    struct tm tm;
 
    my_name_is(argc, argv, "bsmtp");
 
@@ -315,6 +317,11 @@ hp:
       fprintf(sfp, "Cc: %s\r\n", cc_addr);
    }
 
+   /* Add RFC822 date */
+   localtime_r(&now, &tm);
+   strftime(buf, sizeof(buf), "%a, %d %b %Y %H:%M:%S %z", &tm);
+   fprintf(sfp, "Date: %s\r\n", buf);
+
    fprintf(sfp, "\r\n");
 
    /*