Sophie

Sophie

distrib > Mandriva > 2010.1 > x86_64 > by-pkgid > 74be98ecddcf13c43ac242f92de12cdb > files > 1

brltty-4.1-1mdv2010.1.src.rpm

--- brltty-3.9/Programs/misc.c	2007-10-17 08:19:24.000000000 -0700
+++ brltty-3.9/Programs/misc.c.new	2008-07-03 14:24:41.000000000 -0700
@@ -140,13 +140,14 @@
 void
 LogPrint (int level, const char *format, ...) {
   int reason = errno;
-  va_list argp;
+  va_list argp, argp_copy;
 
   if (level <= logLevel) {
 #if defined(HAVE_SYSLOG_H)
     if (syslogOpened) {
 #ifdef HAVE_VSYSLOG
       va_start(argp, format);
+      va_copy(argp_copy, argp);
       vsyslog(level, format, argp);
       va_end(argp);
 #else /* HAVE_VSYSLOG */
@@ -182,8 +183,8 @@
     FILE *stream = stderr;
     if (printPrefix) fprintf(stream, "%s: ", printPrefix);
     va_start(argp, format);
-    vfprintf(stream, format, argp);
-    va_end(argp);
+    vfprintf(stream, format, argp_copy);
+    va_end(argp_copy);
     fprintf(stream, "\n");
     fflush(stream);
   }