X-Git-Url: https://git.tcpdump.org/libpcap/blobdiff_plain/2313c57f712eb052eae992f78ed255a1c5a6e7b7..09b51d326c38ea8e10ce4da09c09d50e08c5aeb8:/pcap-bpf.c?ds=sidebyside diff --git a/pcap-bpf.c b/pcap-bpf.c index 6a8e7747..2898e598 100644 --- a/pcap-bpf.c +++ b/pcap-bpf.c @@ -478,8 +478,8 @@ bpf_open(char *errbuf) { int fd = -1; static const char cloning_device[] = "/dev/bpf"; - int n = 0; - char device[sizeof "/dev/bpf00000000000"]; + u_int n = 0; + char device[sizeof "/dev/bpf0000000000"]; static int no_cloning_bpf = 0; #ifdef _AIX @@ -526,7 +526,7 @@ bpf_open(char *errbuf) * that isn't in use. */ do { - (void)snprintf(device, sizeof(device), "/dev/bpf%d", n++); + (void)snprintf(device, sizeof(device), "/dev/bpf%u", n++); /* * Initially try a read/write open (to allow the inject * method to work). If that fails due to permission