From 73a864c51c35102beba05aa5d36cabb220ae8664 Mon Sep 17 00:00:00 2001 From: Con Kolivas Date: Mon, 11 Jul 2011 21:56:34 +1000 Subject: [PATCH] vfprintf invalidates the va args so do it after the curses output. --- main.c | 2 +- util.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/main.c b/main.c index 00e33695..a3722ae5 100644 --- a/main.c +++ b/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); diff --git a/util.c b/util.c index 90777545..ef680399 100644 --- a/util.c +++ b/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); } }