Wireshark mailing list archives

Re: [Wireshark-commits] rev 51419: /trunk/epan/dissectors/ /trunk/epan/dissectors/: packet-rtpproxy.c


From: Guy Harris <guy () alum mit edu>
Date: Sun, 18 Aug 2013 15:56:06 -0700


On Aug 18, 2013, at 1:04 PM, eapache () wireshark org wrote:

http://anonsvn.wireshark.org/viewvc/viewvc.cgi?view=rev&revision=51419

User: eapache
Date: 2013/08/18 01:04 PM

Log:
Add a cast to try and fix
packet-rtpproxy.c:226: warning: implicit conversion shortens 64-bit value into
a 32-bit value

I'm not quite sure what's going on here, all the values in use are either gint
or guint so they should all be the same size?

In

        new_offset = tvb_skip_wsp(tvb, offset + (strlen("VF") + 1), -1);

one of the values - the return value of strlen() - is size_t, which isn't necessarily gint or guint (or, as Mountain 
Lion's autocorrect would have it, "hint or guilt" :-)), as it's 64-bit in most if not all 64-bit C implementations 
(including MSVC when compiling 64-bit).

I'd make it "(gint)strlen("VF")" (and then I might make it "(sizeof "VF" - 1)", for the benefit of compilers that don't 
do that for you at compile time).
___________________________________________________________________________
Sent via:    Wireshark-dev mailing list <wireshark-dev () wireshark org>
Archives:    http://www.wireshark.org/lists/wireshark-dev
Unsubscribe: https://wireshark.org/mailman/options/wireshark-dev
             mailto:wireshark-dev-request () wireshark org?subject=unsubscribe


Current thread: