file change.
-/* $OpenBSD: nametoaddr.c,v 1.15 2014/12/06 23:20:17 krw Exp $ */
+/* $OpenBSD: nametoaddr.c,v 1.16 2015/01/16 03:19:57 lteo Exp $ */
/*
* Copyright (c) 1990, 1991, 1992, 1993, 1994, 1995, 1996
register u_char *ep, *e;
register u_int d;
- e = ep = (u_char *)malloc(6);
+ e = ep = malloc(6);
if (e == NULL)
bpf_error("malloc");
while ((ep = pcap_next_etherent(fp)) != NULL) {
if (strcmp(ep->name, name) == 0) {
- ap = (u_char *)malloc(6);
+ ap = malloc(6);
if (ap != NULL) {
memcpy(ap, ep->addr, 6);
return (ap);
ap = NULL;
if (ether_hostton(name, (struct ether_addr *)a) == 0) {
- ap = (u_char *)malloc(6);
+ ap = malloc(6);
if (ap != NULL)
memcpy((char *)ap, (char *)a, 6);
}
-/* $OpenBSD: pcap-bpf.c,v 1.25 2015/01/16 03:04:19 lteo Exp $ */
+/* $OpenBSD: pcap-bpf.c,v 1.26 2015/01/16 03:19:57 lteo Exp $ */
/*
* Copyright (c) 1993, 1994, 1995, 1996, 1998
{
memset(bdlp, 0, sizeof(*bdlp));
if (ioctl(fd, BIOCGDLTLIST, (caddr_t)bdlp) == 0) {
- bdlp->bfl_list = (u_int *) calloc(bdlp->bfl_len + 1, sizeof(u_int));
+ bdlp->bfl_list = calloc(bdlp->bfl_len + 1, sizeof(u_int));
if (bdlp->bfl_list == NULL) {
(void)snprintf(ebuf, PCAP_ERRBUF_SIZE, "malloc: %s",
pcap_strerror(errno));
goto bad;
}
p->bufsize = v;
- p->buffer = (u_char *)malloc(p->bufsize);
+ p->buffer = malloc(p->bufsize);
if (p->buffer == NULL) {
snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "malloc: %s",
pcap_strerror(errno));
* Allocate a buffer to hold all the media types, and
* get the media types.
*/
- media_list = (int *) calloc(req.ifm_count, sizeof(int));
+ media_list = calloc(req.ifm_count, sizeof(int));
if (media_list == NULL) {
snprintf(p->errbuf, PCAP_ERRBUF_SIZE, "malloc: %s",
pcap_strerror(errno));
-/* $OpenBSD: pcap.c,v 1.15 2014/06/26 04:03:33 lteo Exp $ */
+/* $OpenBSD: pcap.c,v 1.16 2015/01/16 03:19:57 lteo Exp $ */
/*
* Copyright (c) 1993, 1994, 1995, 1996, 1997, 1998
* DLT for an interface. Return a list of DLTs
* containing only the DLT this device supports.
*/
- *dlt_buffer = (int*)malloc(sizeof(**dlt_buffer));
+ *dlt_buffer = malloc(sizeof(**dlt_buffer));
if (*dlt_buffer == NULL) {
(void)snprintf(p->errbuf, sizeof(p->errbuf),
"malloc: %s", pcap_strerror(errno));
-/* $OpenBSD: savefile.c,v 1.12 2014/03/14 03:45:41 lteo Exp $ */
+/* $OpenBSD: savefile.c,v 1.13 2015/01/16 03:19:57 lteo Exp $ */
/*
* Copyright (c) 1993, 1994, 1995, 1996, 1997
if (p->bufsize < 0)
p->bufsize = BPF_MAXBUFSIZE;
- p->sf.base = (u_char *)malloc(p->bufsize + BPF_ALIGNMENT);
+ p->sf.base = malloc(p->bufsize + BPF_ALIGNMENT);
if (p->sf.base == NULL) {
strlcpy(errbuf, "out of swap", PCAP_ERRBUF_SIZE);
goto bad;
if (tsize < hdr->caplen) {
tsize = ((hdr->caplen + 1023) / 1024) * 1024;
if (tp != NULL)
- free((u_char *)tp);
- tp = (u_char *)malloc(tsize);
+ free(tp);
+ tp = malloc(tsize);
if (tp == NULL) {
tsize = 0;
snprintf(p->errbuf, PCAP_ERRBUF_SIZE,