Browse Source

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

nfactor-troky
Con Kolivas 14 years ago
parent
commit
73a864c51c
  1. 2
      main.c
  2. 2
      util.c

2
main.c

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

2
util.c

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

Loading…
Cancel
Save