From 9cf01ccf8c4d91ecdc4b63302ec1a1d6f8bb797f Mon Sep 17 00:00:00 2001 From: Brian Somers Date: Sun, 8 Aug 1999 15:19:00 +0000 Subject: [PATCH] Don't log_Printf(..., buf) in case buf contains %s Info provided by: Ollivier Robert --- usr.sbin/ppp/log.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/usr.sbin/ppp/log.c b/usr.sbin/ppp/log.c index d51bf28af7db..05d0feae7040 100644 --- a/usr.sbin/ppp/log.c +++ b/usr.sbin/ppp/log.c @@ -23,7 +23,7 @@ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF * SUCH DAMAGE. * - * $Id: log.c,v 1.38 1999/05/12 09:48:52 brian Exp $ + * $Id: log.c,v 1.39 1999/06/01 16:01:48 brian Exp $ */ #include @@ -356,8 +356,8 @@ log_DumpBp(int lev, const char *hdr, const struct mbuf *bp) b += 3; if (b == buf + 48) { memset(b, ' ', 2); - strcpy(c, "\n"); - log_Printf(lev, buf); + *c = '\0'; + log_Printf(lev, "%s\n", buf); b = buf; c = b + 50; } @@ -366,8 +366,8 @@ log_DumpBp(int lev, const char *hdr, const struct mbuf *bp) if (b > buf) { memset(b, ' ', 50 - (b - buf)); - strcpy(c, "\n"); - log_Printf(lev, buf); + *c = '\0'; + log_Printf(lev, "%s\n", buf); } } } @@ -389,8 +389,8 @@ log_DumpBuff(int lev, const char *hdr, const u_char *ptr, int n) *c++ = isprint(*ptr) ? *ptr : '.'; } memset(b, ' ', 50 - (b - buf)); - strcpy(c, "\n"); - log_Printf(lev, buf); + *c = '\0'; + log_Printf(lev, "%s\n", buf); } } }