Skip to content

Commit a5a36d9

Browse files
committed
Fix some format warnings.
1 parent 2909a26 commit a5a36d9

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: sf-pcapng.c

+5-5
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ struct option_header {
8585
* Section Header Block.
8686
*/
8787
#define BT_SHB 0x0A0D0D0A
88-
#define BT_SHB_INSANE_MAX 1024*1024*1 /* 1MB should be enough */
88+
#define BT_SHB_INSANE_MAX 1024U*1024U*1U /* 1MB should be enough */
8989
struct section_header_block {
9090
bpf_u_int32 byte_order_magic;
9191
u_short major_version;
@@ -859,10 +859,10 @@ pcap_ng_check_header(const uint8_t *magic, FILE *fp, u_int precision,
859859
if (total_length < sizeof(*bhdrp) + sizeof(*shbp) + sizeof(struct block_trailer) ||
860860
(total_length > BT_SHB_INSANE_MAX)) {
861861
pcap_snprintf(errbuf, PCAP_ERRBUF_SIZE,
862-
"Section Header Block in pcapng dump file has invalid length %" PRIsize " < _%lu_ < %lu (BT_SHB_INSANE_MAX)",
863-
sizeof(*bhdrp) + sizeof(*shbp) + sizeof(struct block_trailer),
864-
total_length,
865-
BT_SHB_INSANE_MAX);
862+
"Section Header Block in pcapng dump file has invalid length %" PRIsize " < _%u_ < %u (BT_SHB_INSANE_MAX)",
863+
sizeof(*bhdrp) + sizeof(*shbp) + sizeof(struct block_trailer),
864+
total_length,
865+
BT_SHB_INSANE_MAX);
866866

867867
*err = 1;
868868
return (NULL);

0 commit comments

Comments
 (0)