} else if (sizeof(char *) == 8) {
value = va_arg(args, uint64_t);
} else {
- value = (uint64_t)va_arg(args, char *);
+ value = 0; /* we have a problem */
}
currlen = fmtint(buffer, currlen, maxlen, value, 16, min, max, flags);
break;
time_t now = time(NULL);
struct tm tm;
char tzbuf[MAXSTRING];
+ long my_timezone;
/* Add RFC822 date */
(void)localtime_r(&now, &tm);
#if defined(HAVE_MINGW)
__MINGW_IMPORT long _dstbias;
#endif
- long tzoffset = 0;
-
_tzset();
+ my_timezone = _timezone;
+ my_timezone += _dstbias;
+ my_timezone /= 60;
- tzoffset = _timezone;
- tzoffset += _dstbias;
- tzoffset /= 60;
-
- size_t length = strftime(buf, buf_len, "%a, %d %b %Y %H:%M:%S", &tm);
- sprintf(&buf[length], " %+2.2ld%2.2u", -tzoffset / 60, abs(tzoffset) % 60);
#else
- strftime(buf, buf_len, "%a, %d %b %Y %H:%M:%S", &tm);
tzset();
- timezone /= 60; /* timezone offset in mins */
+ my_timezone = timezone / 60; /* timezone offset in mins */
if (tm.tm_isdst == 1) {
- timezone -= 60; /* adjust for daylight savings */
+ my_timezone -= 60; /* adjust for daylight savings */
}
- sprintf(tzbuf, " %+2.2ld%2.2u", -timezone / 60, abs(timezone) % 60);
+#endif
+ strftime(buf, buf_len, "%a, %d %b %Y %H:%M:%S", &tm);
+ sprintf(tzbuf, " %+2.2ld%2.2u", -my_timezone / 60, abs(my_timezone) % 60);
strcat(buf, tzbuf); /* add +0100 */
strftime(tzbuf, sizeof(tzbuf), " (%Z)", &tm);
strcat(buf, tzbuf); /* add (CEST) */
-#endif
}
Technical notes on version 2.1
General:
+15May07
+kes Rework bsmtp date editing for Win32.
+kes Add new cats entry point so Win32 builds.
14May07
-kes Attempt to fix bsmtp editing on OSes without %z editing.
+kes Attempt to fix bsmtp date editing on OSes without %z editing.
Fixes bug #854.
kes Do better checking for the MySQL 64 bit libraries looking for both
.a and .so libraries.