Home page logo

wireshark logo 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:


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

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?


        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

  By Date           By Thread  

Current thread:
[ Nmap | Sec Tools | Mailing Lists | Site News | About/Contact | Advertising | Privacy ]