--- suX/src/sux.c 2011/05/20 16:41:31 1.1.1.1.2.4 +++ suX/src/sux.c 2011/05/20 17:03:28 1.1.1.1.2.5 @@ -3,7 +3,7 @@ * by Michael Pounov * * $Author: misho $ - * $Id: sux.c,v 1.1.1.1.2.4 2011/05/20 16:41:31 misho Exp $ + * $Id: sux.c,v 1.1.1.1.2.5 2011/05/20 17:03:28 misho Exp $ * *************************************************************************/ #include "global.h" @@ -18,27 +18,31 @@ FILE *lf; static inline void Log(int lvl, const char *fmt, ...) { - va_list lst; + va_list lst, cp; if (lvl <= Verbose) { va_start(lst, fmt); + va_copy(cp, lst); vfprintf(lf, fmt, lst); - fprintf(lf, "\n"); - vsyslog(LOG_WARNING, fmt, lst); va_end(lst); + fprintf(lf, "\n"); + vsyslog(LOG_WARNING, fmt, cp); + va_end(cp); } } static inline void Err(const char *fmt, ...) { - va_list lst; + va_list lst, cp; va_start(lst, fmt); + va_copy(cp, lst); vfprintf(lf, fmt, lst); - fprintf(lf, "\n"); - vsyslog(LOG_ERR, fmt, lst); va_end(lst); + fprintf(lf, "\n"); + vsyslog(LOG_ERR, fmt, cp); + va_end(cp); } static void