]> The Tcpdump Group git mirrors - libpcap/commitdiff
Fix some format warnings.
authorGuy Harris <[email protected]>
Thu, 26 Sep 2019 20:59:04 +0000 (13:59 -0700)
committerGuy Harris <[email protected]>
Wed, 2 Oct 2019 20:45:22 +0000 (13:45 -0700)
sf-pcapng.c

index 225d9aaac85936a1579cf64c072c7602a460ca05..78f19a4df06a21a172f37d71429aa2055741014f 100644 (file)
@@ -85,7 +85,7 @@ struct option_header {
  * Section Header Block.
  */
 #define BT_SHB                 0x0A0D0D0A
  * 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;
 struct section_header_block {
        bpf_u_int32     byte_order_magic;
        u_short         major_version;
@@ -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)) {
                snprintf(errbuf, PCAP_ERRBUF_SIZE,
        if (total_length < sizeof(*bhdrp) + sizeof(*shbp) + sizeof(struct block_trailer) ||
             (total_length > BT_SHB_INSANE_MAX)) {
                snprintf(errbuf, PCAP_ERRBUF_SIZE,
-                   "Section Header Block in pcapng dump file has invalid length %zu < _%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 %zu < _%u_ < %u (BT_SHB_INSANE_MAX)",
+                   sizeof(*bhdrp) + sizeof(*shbp) + sizeof(struct block_trailer),
+                   total_length,
+                   BT_SHB_INSANE_MAX);
 
                *err = 1;
                return (NULL);
 
                *err = 1;
                return (NULL);