Squelch a compiler warning - but note, in a comment, a real problem the
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 3 May 2011 05:50:30 +0000 (05:50 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Tue, 3 May 2011 05:50:30 +0000 (05:50 +0000)
warning points out.

git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@36972 f5534014-38df-0310-8fa8-9805f1628bb7

wiretap/network_instruments.c

index 87654a96c5fc0ac5c118fdc6d596b793fb3bd177..729c199f60239f2067a539d7c12ab101e46ae40c 100644 (file)
@@ -676,7 +676,8 @@ static gboolean observer_dump(wtap_dumper *wdh, const struct wtap_pkthdr *phdr,
     packet_header.captured_size = (guint16) phdr->caplen;
     packet_header.network_size = (guint16) (phdr->len + 4);
     packet_header.offset_to_frame = sizeof(packet_header);
-    packet_header.offset_to_next_packet = sizeof(packet_header) + phdr->caplen;
+    /* XXX - what if this doesn't fit in 16 bits?  It's not guaranteed to... */
+    packet_header.offset_to_next_packet = (guint16)sizeof(packet_header) + phdr->caplen;
     packet_header.network_type = private_state->network_type;
     packet_header.flags = 0x00;
     packet_header.number_of_information_elements = 0;