From 486b8925ecb0d408e403474828e20c1cce8aaec8 Mon Sep 17 00:00:00 2001 From: brian Date: Sun, 26 Oct 1997 01:04:02 +0000 Subject: Cosmetic (no functional changes): o Add missing $Id$s o Move extern decls from .c -> .h files o Staticize o Remove #includes from .h files o style(9)ify includes o bcopy -> memcpy bzero -> memset bcmp -> memcmp index -> strchr rindex -> strrchr o Move timeout.h -> timer.h (making it consistent w/ timer.c) o Add -Wmissing-prototypes --- usr.sbin/ppp/mbuf.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) (limited to 'usr.sbin/ppp/mbuf.c') diff --git a/usr.sbin/ppp/mbuf.c b/usr.sbin/ppp/mbuf.c index a66bd6f..8a86e90 100644 --- a/usr.sbin/ppp/mbuf.c +++ b/usr.sbin/ppp/mbuf.c @@ -17,15 +17,22 @@ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE. * - * $Id: mbuf.c,v 1.8 1997/06/25 19:30:02 brian Exp $ + * $Id: mbuf.c,v 1.9 1997/08/25 00:29:20 brian Exp $ * */ -#include -#include #include +#include #include + +#include +#include +#include + +#include "mbuf.h" +#include "log.h" #include "defs.h" #include "loadalias.h" +#include "command.h" #include "vars.h" #include "server.h" @@ -60,7 +67,7 @@ mballoc(int cnt, int type) ServerClose(); exit(1); } - bzero(bp, sizeof(struct mbuf)); + memset(bp, '\0', sizeof(struct mbuf)); p = (u_char *) malloc(cnt); if (p == NULL) { LogPrintf(LogALERT, "failed to allocate memory: %d\n", cnt); @@ -108,7 +115,7 @@ mbread(struct mbuf * bp, u_char * ptr, int len) nb = bp->cnt; else nb = len; - bcopy(MBUF_CTOP(bp), ptr, nb); + memcpy(ptr, MBUF_CTOP(bp), nb); ptr += nb; bp->cnt -= nb; len -= nb; @@ -136,7 +143,7 @@ mbwrite(struct mbuf * bp, u_char * ptr, int cnt) while (cnt > 0) { nb = (cnt < bp->cnt) ? cnt : bp->cnt; - bcopy(ptr, MBUF_CTOP(bp), nb); + memcpy(MBUF_CTOP(bp), ptr, nb); cnt -= bp->cnt; bp = bp->next; } -- cgit v1.1