diff options
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; } |