aboutsummaryrefslogtreecommitdiff
path: root/pcap-snit.c
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2015-08-09 16:01:40 -0700
committerGuy Harris <guy@alum.mit.edu>2015-08-09 16:01:40 -0700
commitb0f028907bac3a1b4cbabd0faade2a72e0753ee8 (patch)
treedf1ca401e612221337b0fd62b569b471cd95b15c /pcap-snit.c
parent4ad986a1659485b72b4c7bdb7ceba6e8c527c217 (diff)
Make the buffer member of a pcap_t a void *.
Yes, in some sense, it's an array of bytes - on modern processors, *all* data is ultimately an array of bytes - but different modules will use it in different ways, not all of which will be an undifferentiated array of bytes. This squelches a complaint from the Clang static analyzer. Clean up some code while we're at it.
Diffstat (limited to 'pcap-snit.c')
-rw-r--r--pcap-snit.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/pcap-snit.c b/pcap-snit.c
index 0ce78603..c6d8a93f 100644
--- a/pcap-snit.c
+++ b/pcap-snit.c
@@ -134,7 +134,7 @@ pcap_read_snit(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
pcap_strerror(errno));
return (-1);
}
- bp = p->buffer;
+ bp = (u_char *)p->buffer;
} else
bp = p->bp;
@@ -378,7 +378,7 @@ pcap_activate_snit(pcap_t *p)
p->linktype = DLT_EN10MB;
p->bufsize = BUFSPACE;
- p->buffer = (u_char *)malloc(p->bufsize);
+ p->buffer = malloc(p->bufsize);
if (p->buffer == NULL) {
strlcpy(p->errbuf, pcap_strerror(errno), PCAP_ERRBUF_SIZE);
goto bad;