diff options
author | brian <brian@FreeBSD.org> | 1997-10-26 01:04:02 +0000 |
---|---|---|
committer | brian <brian@FreeBSD.org> | 1997-10-26 01:04:02 +0000 |
commit | 486b8925ecb0d408e403474828e20c1cce8aaec8 (patch) | |
tree | cca66974908224bf517868aaafb2e4acd1abe88d /usr.sbin/ppp/mbuf.c | |
parent | 1d2927c9fac7bcfe68bf6ab502c716adc91d6f09 (diff) | |
download | FreeBSD-src-486b8925ecb0d408e403474828e20c1cce8aaec8.zip FreeBSD-src-486b8925ecb0d408e403474828e20c1cce8aaec8.tar.gz |
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
Diffstat (limited to 'usr.sbin/ppp/mbuf.c')
-rw-r--r-- | usr.sbin/ppp/mbuf.c | 19 |
1 files changed, 13 insertions, 6 deletions
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 <sys/types.h> -#include <sys/socket.h> #include <sys/param.h> +#include <sys/socket.h> #include <netinet/in.h> + +#include <stdio.h> +#include <stdlib.h> +#include <string.h> + +#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; } |