diff options
author | brian <brian@FreeBSD.org> | 1999-08-08 15:19:00 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1999-08-08 15:19:00 +0000 |
commit | 864dcd0b2ff09d9ad5e504f98ede3ef212ada6d0 (patch) | |
tree | 91073da2d9a5c7b6d05be2f0413173b84ffea6b5 /usr.sbin/ppp/log.c | |
parent | 42539e65d17cc136a3e363466b97ba8ec0514e0e (diff) | |
download | FreeBSD-src-864dcd0b2ff09d9ad5e504f98ede3ef212ada6d0.zip FreeBSD-src-864dcd0b2ff09d9ad5e504f98ede3ef212ada6d0.tar.gz |
Don't log_Printf(..., buf) in case buf contains %s
Info provided by: Ollivier Robert <roberto@keltia.freenix.fr>
Diffstat (limited to 'usr.sbin/ppp/log.c')
-rw-r--r-- | usr.sbin/ppp/log.c | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/usr.sbin/ppp/log.c b/usr.sbin/ppp/log.c index d51bf28..05d0fea 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 <sys/types.h> @@ -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); } } } |