fix va_calls for 64bit systems

This commit is contained in:
Axel Kittenberger 2010-07-09 06:40:53 +00:00
parent 7d053d0679
commit 2092eff408

View File

@ -452,8 +452,6 @@ void printlogf(int level, const char *fmt, ...)
} }
} }
va_start(ap, fmt);
time(&mtime); time(&mtime);
ct = ctime(&mtime); ct = ctime(&mtime);
ct[strlen(ct) - 1] = 0; // cut trailing linefeed ct[strlen(ct) - 1] = 0; // cut trailing linefeed
@ -495,12 +493,18 @@ void printlogf(int level, const char *fmt, ...)
} }
if (flog1) { if (flog1) {
va_start(ap, fmt);
vfprintf(flog1, fmt, ap); vfprintf(flog1, fmt, ap);
va_end(ap);
} else { } else {
va_start(ap, fmt);
vsyslog(sysp, fmt, ap); vsyslog(sysp, fmt, ap);
va_end(ap);
} }
if (flog2) { if (flog2) {
va_start(ap, fmt);
vfprintf(flog2, fmt, ap); vfprintf(flog2, fmt, ap);
va_end(ap);
} }
if (flog1) { if (flog1) {
@ -509,7 +513,6 @@ void printlogf(int level, const char *fmt, ...)
if (flog2) { if (flog2) {
fprintf(flog2, "\n"); fprintf(flog2, "\n");
} }
va_end(ap);
if (flog1) { if (flog1) {
fclose(flog1); fclose(flog1);