summaryrefslogtreecommitdiffstats
path: root/usr.sbin/ppp/mbuf.c
diff options
context:
space:
mode:
authorbrian <brian@FreeBSD.org>1997-10-26 01:04:02 +0000
committerbrian <brian@FreeBSD.org>1997-10-26 01:04:02 +0000
commit486b8925ecb0d408e403474828e20c1cce8aaec8 (patch)
treecca66974908224bf517868aaafb2e4acd1abe88d /usr.sbin/ppp/mbuf.c
parent1d2927c9fac7bcfe68bf6ab502c716adc91d6f09 (diff)
downloadFreeBSD-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.c19
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;
}
OpenPOWER on IntegriCloud