Wireshark-dev: Re: [Wireshark-dev] Wireshark Qt : Decode As
From: Guy Harris <[email protected]>
Date: Mon, 4 Aug 2014 15:33:29 -0700
On Aug 4, 2014, at 1:13 PM, Alexis La Goutte <[email protected]> wrote:

> The decode As feature work for you with Wireshark Qt (qtshark)
> 
> I have try on Windows, Linux, Mac OS X and don't work for me... (the
> value is never save...)

Isn't saved, as in "isn't written to the decode_as_entries file", or is saved but doesn't work?

> if i try with GTK and reopen with Qt works...

For uint dissector tables, GTK+ was writing out the value in decimal, regardless of the base of the value for the table; Qt was writing it out in hex if the base for the value was hex.

The code to *read* the tables assumed decimal, and read a hex value as 0, because it was using atoi().  I fixed it to use strtol() with a base argument of 0 (so that a number beginning with 0x or 0X is treated as hex), and to check that that the string was a valid number and the value was in the range 0 -> UINT_MAX and report lines where it isn't.

This fixes it to the extent that the saved values work; I backported that fix to the 1.12 branch.

However, if I change it in Qt, the change doesn't take effect until I quit and restart Wireshark, so there's another bug hiding there.