From f773b1c56122feaff9e9ecabbde3326b7c081233 Mon Sep 17 00:00:00 2001 From: Francois-Xavier Le Bail Date: Fri, 9 Aug 2019 09:53:24 +0200 Subject: Use %zu as the print format for size_t C99 support it and also Visual Studio VS 2015 and after. No more need for PRIsize format. --- sf-pcap.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'sf-pcap.c') diff --git a/sf-pcap.c b/sf-pcap.c index c48faf5d..cb980ce7 100644 --- a/sf-pcap.c +++ b/sf-pcap.c @@ -195,7 +195,7 @@ pcap_check_header(const uint8_t *magic, FILE *fp, u_int precision, char *errbuf, errno, "error reading dump file"); } else { pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE, - "truncated dump file; tried to read %" PRIsize " file header bytes, only got %" PRIsize, + "truncated dump file; tried to read %zu file header bytes, only got %zu", sizeof(hdr), amt_read); } *err = 1; @@ -462,7 +462,7 @@ pcap_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char **data) } else { if (amt_read != 0) { pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE, - "truncated dump file; tried to read %" PRIsize " header bytes, only got %" PRIsize, + "truncated dump file; tried to read %zu header bytes, only got %zu", ps->hdrsize, amt_read); return (-1); } @@ -622,7 +622,7 @@ pcap_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char **data) * the read finished. */ pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE, - "truncated dump file; tried to read %u captured bytes, only got %" PRIsize, + "truncated dump file; tried to read %u captured bytes, only got %zu", p->snapshot, amt_read); } return (-1); @@ -646,7 +646,7 @@ pcap_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char **data) "error reading dump file"); } else { pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE, - "truncated dump file; tried to read %u captured bytes, only got %" PRIsize, + "truncated dump file; tried to read %u captured bytes, only got %zu", hdr->caplen, bytes_read); } return (-1); @@ -698,7 +698,7 @@ pcap_next_packet(pcap_t *p, struct pcap_pkthdr *hdr, u_char **data) "error reading dump file"); } else { pcap_snprintf(p->errbuf, PCAP_ERRBUF_SIZE, - "truncated dump file; tried to read %u captured bytes, only got %" PRIsize, + "truncated dump file; tried to read %u captured bytes, only got %zu", hdr->caplen, amt_read); } return (-1); -- cgit v1.2.1