Fix #62, merge branch 'fix-log-stdarg' into development

Replaces ®om's 64-bit fix with a simpler one (using the C99 va_copy()
primitive) that does not remove the vlogMessage() function
This commit is contained in:
Andrew Bettison 2013-06-06 16:59:03 +09:30
commit 4e3c93e00a

14
log.c
View File

@ -395,9 +395,10 @@ static void _log_iterator_printf_nl(_log_iterator *it, int level, struct __sourc
_log_iterator_rewind(it);
while (_log_iterator_next(it, level)) {
_log_prefix_whence(it, whence);
va_start(ap, fmt);
vxprintf(it->xpf, fmt, ap);
va_end(ap);
va_list ap1;
va_copy(ap1, ap);
vxprintf(it->xpf, fmt, ap1);
va_end(ap1);
}
}
@ -681,9 +682,10 @@ void logMessage(int level, struct __sourceloc whence, const char *fmt, ...)
_rotate_log_file(&it);
while (_log_iterator_next(&it, level)) {
_log_prefix_whence(&it, whence);
va_start(ap, fmt);
vxprintf(it.xpf, fmt, ap);
va_end(ap);
va_list ap1;
va_copy(ap1, ap);
vxprintf(it.xpf, fmt, ap1);
va_end(ap1);
}
}
}