Wireshark mailing list archives

Re: [Wireshark-commits] rev 39559: /trunk/epan/ /trunk/epan/: proto.c


From: Jeff Morriss <jeff.morriss.ws () gmail com>
Date: Tue, 25 Oct 2011 14:43:25 -0400

Guy Harris wrote:
On Oct 25, 2011, at 10:49 AM, Stig Bjørlykke wrote:

But now I don't understand the question...

Sorry, I misread the checkin comment

        Allow signed integers displayed as DEC_HEX.

as

        Allow signed integers displayed as BASE_HEX.

It might have been a bit harder to misread if it were

        Allow signed integers displayed as BASE_DEC_HEX.

We should probably allow BASE_HEX_DEC as well.

That would, as per this comment:

                /*      Hexadecimal and octal are, in printf() and everywhere
                 *      else, unsigned so don't allow dissectors to register a
                 *      signed field to be displayed unsigned.  (Else how would
                 *      we display negative values?)
                 *
                 *      If you want to take out this check, be sure to fix
                 *      hfinfo_numeric_format() so that it does not assert out
                 *      when trying to construct a hexadecimal representation of
                 *      FT_INT*.
                 */

also require modifying hfinfo_numeric_format() to be able to generate representations of negative hexadecimal numbers (so as to prevent "Apply as filter" on a signed BASE_HEX_DEC field whose decimal value is negative from causing an abort).

If that's done we may as well let in BASE_HEX and BASE_OCT too.

This stuff came in rev 24643/bug 1539. (See the later comments in the bug for at least one developer who wasn't happy about these checks being put in.)
___________________________________________________________________________
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: