Skip to content

Commit

Permalink
Fix some format warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
guyharris committed Sep 30, 2019
1 parent 2909a26 commit a5a36d9
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions sf-pcapng.c
Expand Up @@ -85,7 +85,7 @@ struct option_header {
* Section Header Block.
*/
#define BT_SHB 0x0A0D0D0A
#define BT_SHB_INSANE_MAX 1024*1024*1 /* 1MB should be enough */
#define BT_SHB_INSANE_MAX 1024U*1024U*1U /* 1MB should be enough */
struct section_header_block {
bpf_u_int32 byte_order_magic;
u_short major_version;
Expand Down Expand Up @@ -859,10 +859,10 @@ pcap_ng_check_header(const uint8_t *magic, FILE *fp, u_int precision,
if (total_length < sizeof(*bhdrp) + sizeof(*shbp) + sizeof(struct block_trailer) ||
(total_length > BT_SHB_INSANE_MAX)) {
pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE,
"Section Header Block in pcapng dump file has invalid length %" PRIsize " < _%lu_ < %lu (BT_SHB_INSANE_MAX)",
sizeof(*bhdrp) + sizeof(*shbp) + sizeof(struct block_trailer),
total_length,
BT_SHB_INSANE_MAX);
"Section Header Block in pcapng dump file has invalid length %" PRIsize " < _%u_ < %u (BT_SHB_INSANE_MAX)",
sizeof(*bhdrp) + sizeof(*shbp) + sizeof(struct block_trailer),
total_length,
BT_SHB_INSANE_MAX);

*err = 1;
return (NULL);
Expand Down

0 comments on commit a5a36d9

Please sign in to comment.