diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/makefield.cc | 5 | ||||
-rw-r--r-- | lib/makefield.h | 2 |
2 files changed, 4 insertions, 3 deletions
diff --git a/lib/makefield.cc b/lib/makefield.cc index 34bb092..ecf31ac 100644 --- a/lib/makefield.cc +++ b/lib/makefield.cc @@ -26,10 +26,11 @@ #include "itoa.h" #include "mystring/mystring.h" -mystring make_date() +mystring make_date(time_t t) { char buf[256]; - time_t t = time(0); + if (t == 0) + t = time(0); struct tm* l = localtime(&t); strftime(buf, 256, "%a, %d %b %Y %H:%M:%S ", l); #ifdef TM_HAS_GMTOFF diff --git a/lib/makefield.h b/lib/makefield.h index a73ddc4..9686ef2 100644 --- a/lib/makefield.h +++ b/lib/makefield.h @@ -1,7 +1,7 @@ #ifndef NULLMAILER__MAKEFIELD__H__ #define NULLMAILER__MAKEFIELD__H__ -extern mystring make_date(); +extern mystring make_date(time_t t = 0); extern mystring make_messageid(const mystring& idhost); extern mystring make_boundary(); |