Browse Source

vfprintf invalidates the va args so do it after the curses output.

Con Kolivas 14 years ago
parent
commit
73a864c51c
2 changed files with 2 additions and 2 deletions
  1. 1 1
      main.c
  2. 1 1
      util.c

+ 1 - 1
main.c

@@ -601,7 +601,7 @@ void log_curses(const char *f, va_list ap)
 
 	if (unlikely(!curses_active))
 		return;
-	vwprintw(mainwin, f, ap);
+	vw_printw(mainwin, f, ap);
 	clrtoeol();
 	getyx(mainwin, logcursor, x);
 

+ 1 - 1
util.c

@@ -90,12 +90,12 @@ void vapplog(int prio, const char *fmt, va_list ap)
 			tm.tm_min,
 			tm.tm_sec,
 			fmt);
+		log_curses(f, ap);
 		/* Only output to stderr if it's not going to the screen as well */
 		if (opt_log_output && !isatty(fileno((FILE *)stderr))) {
 			vfprintf(stderr, f, ap);	/* atomic write to stderr */
 			fflush(stderr);
 		}
-		log_curses(f, ap);
 	}
 }