diff options
author | brian <brian@FreeBSD.org> | 2001-06-18 23:24:26 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 2001-06-18 23:24:26 +0000 |
commit | 12a7d2d747f6262cecffe2ee12513d0868aba3a3 (patch) | |
tree | c86971f732b1ef4564647cdb52e3507a57d2ed07 /usr.sbin | |
parent | 0f5efa86e5d00f56f82663a4b3abe375cfe6a8e1 (diff) | |
download | FreeBSD-src-12a7d2d747f6262cecffe2ee12513d0868aba3a3.zip FreeBSD-src-12a7d2d747f6262cecffe2ee12513d0868aba3a3.tar.gz |
Call va_start/va_end for each call to vfprintf
Obtained from: OpenBSD
Diffstat (limited to 'usr.sbin')
-rw-r--r-- | usr.sbin/ppp/log.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/usr.sbin/ppp/log.c b/usr.sbin/ppp/log.c index d31d9c9..30f0b12 100644 --- a/usr.sbin/ppp/log.c +++ b/usr.sbin/ppp/log.c @@ -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 |