diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2001-06-13 11:46:15 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2001-06-13 11:46:15 +0000 |
commit | 0dd20fb220c92ea813890d4de615696232dff944 (patch) | |
tree | 245a01cfcb508f2c00f8e17d9fd99b0e5fbd8182 /usr.sbin | |
parent | 4ed8c62fd2a75d6d74a778cb00fd8c5f95bd749d (diff) |
va_start/end for every call to vfprintf, ok brian@
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/ppp/log.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.sbin/ppp/ppp/log.c b/usr.sbin/ppp/ppp/log.c index ae8b100bac1..93de37cb5d2 100644 --- a/usr.sbin/ppp/ppp/log.c +++ b/usr.sbin/ppp/ppp/log.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $OpenBSD: log.c,v 1.12 2000/11/02 00:54:34 brian Exp $ + * $OpenBSD: log.c,v 1.13 2001/06/13 11:46:14 markus Exp $ */ #include <sys/types.h> @@ -306,10 +306,10 @@ log_Printf(int lev, const char *fmt,...) va_list ap; struct prompt *prompt; - va_start(ap, fmt); if (log_IsKept(lev)) { char nfmt[200]; + va_start(ap, fmt); if (promptlist && (log_IsKept(lev) & LOG_KEPT_LOCAL)) { if ((log_IsKept(LogTUN) & LOG_KEPT_LOCAL) && LogTunno != -1) snprintf(nfmt, sizeof nfmt, "%s%d: %s: %s", TUN_NAME, @@ -324,7 +324,9 @@ log_Printf(int lev, const char *fmt,...) if (lev > LogMAXCONF || (prompt->logmask & MSK(lev))) prompt_vPrintf(prompt, nfmt, ap); } + va_end(ap); + va_start(ap, fmt); if ((log_IsKept(lev) & LOG_KEPT_SYSLOG) && (lev != LogWARN || !log_PromptContext)) { if ((log_IsKept(LogTUN) & LOG_KEPT_SYSLOG) && LogTunno != -1) @@ -334,8 +336,8 @@ log_Printf(int lev, const char *fmt,...) snprintf(nfmt, sizeof nfmt, "%s: %s", log_Name(lev), fmt); vsyslog(syslogLevel(lev), nfmt, ap); } + va_end(ap); } - va_end(ap); } void |