summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGuy Harris <gharris@sonic.net>2023-05-09 00:58:11 -0700
committerGitHub <noreply@github.com>2023-05-09 00:58:11 -0700
commit11deffef24aee117692408671d382a44a3bbdbf2 (patch)
treed667a4eead1fa6c058a4fcdfb2c247101144f1a8
parentd0d871bba01c316c63fb3dc4883dce338b3f5779 (diff)
parent9dc97f3ab68c4ca1af93bb9d093a5570fe42b20f (diff)
downloadlibpcap-11deffef24aee117692408671d382a44a3bbdbf2.tar.gz
Merge pull request #1180 from AtariDreams/str
Use the intended date types for variables passed as or compared to other types
-rw-r--r--instrument-functions.c2
-rw-r--r--pcap-bpf.c4
-rw-r--r--pcap-dpdk.c4
3 files changed, 5 insertions, 5 deletions
diff --git a/instrument-functions.c b/instrument-functions.c
index 2c1ad332..67bcbd3e 100644
--- a/instrument-functions.c
+++ b/instrument-functions.c
@@ -77,7 +77,7 @@ static void print_debug(void *this_fn, void *call_site, action_type action)
static int instrument_set;
static int instrument_off;
static int instrument_global;
- int i;
+ long i;
if (!instrument_set) {
static char *instrument_type;
diff --git a/pcap-bpf.c b/pcap-bpf.c
index 92e73adf..f8d10833 100644
--- a/pcap-bpf.c
+++ b/pcap-bpf.c
@@ -1061,7 +1061,7 @@ static int
pcap_read_bpf(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
{
struct pcap_bpf *pb = p->priv;
- int cc;
+ ssize_t cc;
int n = 0;
register u_char *bp, *ep;
u_char *datap;
@@ -1107,7 +1107,7 @@ pcap_read_bpf(pcap_t *p, int cnt, pcap_handler callback, u_char *user)
} else
#endif
{
- cc = (int)read(p->fd, p->buffer, p->bufsize);
+ cc = read(p->fd, p->buffer, p->bufsize);
}
if (cc < 0) {
/* Don't choke when we get ptraced */
diff --git a/pcap-dpdk.c b/pcap-dpdk.c
index 025a6748..844db652 100644
--- a/pcap-dpdk.c
+++ b/pcap-dpdk.c
@@ -529,8 +529,8 @@ static void eth_addr_str(ETHER_ADDR_TYPE *addrp, char* mac_str, int len)
static uint16_t portid_by_device(char * device)
{
uint16_t ret = DPDK_PORTID_MAX;
- int len = strlen(device);
- int prefix_len = strlen(DPDK_PREFIX);
+ size_t len = strlen(device);
+ size_t prefix_len = strlen(DPDK_PREFIX);
unsigned long ret_ul = 0L;
char *pEnd;
if (len<=prefix_len || strncmp(device, DPDK_PREFIX, prefix_len)) // check prefix dpdk: