If only part of an entry in an object fits in the object, don't report
authorguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 29 Jun 2005 23:19:21 +0000 (23:19 +0000)
committerguy <guy@f5534014-38df-0310-8fa8-9805f1628bb7>
Wed, 29 Jun 2005 23:19:21 +0000 (23:19 +0000)
the stuff that didn't fit as a negative number of junk bytes.

The difference between two pointers isn't guaranteed to have a
particular size; cast it to "long" and display it with "%ld".

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

epan/dissectors/packet-ip.c

index 10468115c2d689653d2cdec0a2963e804c0c69ef..5800c97890f539f947dd350b7058914f2e2266d6 100644 (file)
@@ -1530,12 +1530,12 @@ dissect_mpls_extensions(tvbuff_t *tvb, size_t offset, proto_tree *tree)
 
                         } /* end while */
 
-                        if (offset != obj_end_offset)
+                        if (offset < obj_end_offset)
                             proto_tree_add_text(mpls_object_tree, tvb,
                                                 offset,
                                                 obj_end_offset - offset,
-                                                "%d junk bytes",
-                                                obj_end_offset - offset);
+                                                "%ld junk bytes",
+                                                (long)(obj_end_offset - offset));
 
                         break;
                     default: