| diff -up authd-1.4.3/authd.c.valist authd-1.4.3/authd.c |
| |
| |
| @@ -80,13 +80,16 @@ static void log_printf(int level, const |
| if (opt.debug || level != LOG_DEBUG) { |
| va_list ap; |
| |
| - va_start(ap, s); |
| if (s == NULL || *s == '\0') { |
| s = strerror(errno); |
| assert(strchr(s, '%') == NULL); |
| } |
| - if (opt.log) |
| + if (opt.log) { |
| + va_start(ap, s); |
| vsyslog(level, s, ap); |
| + va_end(ap); |
| + } |
| + va_start(ap, s); |
| if (vfprintf(level == LOG_INFO ? stdout : stderr, s, ap) < 0) { |
| perror(program_invocation_name); |
| level = INT_MIN; |