Re: [Wireshark-dev] Is there a need for a 0, NULL element at the end of value strings

2018-10-16 Thread Richard Sharpe
On Tue, Oct 16, 2018 at 10:21 AM Guy Harris wrote: > > On Oct 16, 2018, at 8:30 AM, Richard Sharpe > wrote: > > > OK, ignore me. When you call g_array_new with TRUE in the first > > argument you get a ZERO entry on the end. > > The fact that you had to ask this question - and probably had to

Re: [Wireshark-dev] Is there a need for a 0, NULL element at the end of value strings

2018-10-16 Thread Guy Harris
On Oct 16, 2018, at 8:30 AM, Richard Sharpe wrote: > OK, ignore me. When you call g_array_new with TRUE in the first > argument you get a ZERO entry on the end. The fact that you had to ask this question - and probably had to look that up in the GLib documentation - suggests that there should

[Wireshark-dev] While there is a val64_string structure and functions, there is no ran64_string

2018-10-16 Thread Richard Sharpe
Hi folks, I see that there is a val64_structure and various functions using it there seems to be no ran64_string (the 64-bit version of range_strings). Is that because no one has needed it until now? -- Regards, Richard Sharpe (何以解憂?唯有杜康。--曹操)(传说杜康是酒的发明者)

[Wireshark-dev] More Lua tests needed

2018-10-16 Thread Richard Sharpe
Hi folks, During testing of my changes to add support for Range Strings to the Lua support I found that there was a serious bug in the support for value strings. It was trying to ensure that the value passed in was a string, but the function lua_isstring will return true for strings and

[Wireshark-dev] Hints needed on how to write a negative Lua test ...

2018-10-16 Thread Richard Sharpe
Hi folks, I added the following change to tests/lua/tvb.lua: --- test/lua/tvb.lua2018-10-16 20:24:27.603826969 -0700 +++ ../tvb.lua 2018-10-16 20:24:19.060549963 -0700 @@ -198,6 +198,21 @@ print("test_proto ProtoFields registered") +local new_range_string = { + { 0, 200, "The first

[Wireshark-dev] Is there a need for a 0, NULL element at the end of value strings

2018-10-16 Thread Richard Sharpe
Hi folks, I have always put a {0, NULL} element on the end of value strings, but it seems the lua code for constructing value strings when you use ProtoField(..., some_value_string) does not terminate the list with an empty element, and my test did not cause a crash. Rather, I got an "unknown"

Re: [Wireshark-dev] Is there a need for a 0, NULL element at the end of value strings

2018-10-16 Thread Pascal Quantin
Hi Richard, Le mar. 16 oct. 2018 à 17:26, Richard Sharpe a écrit : > Hi folks, > > I have always put a {0, NULL} element on the end of value strings, but > it seems the lua code for constructing value strings when you use > ProtoField(..., some_value_string) does not terminate the list with an

Re: [Wireshark-dev] Is there a need for a 0, NULL element at the end of value strings

2018-10-16 Thread Richard Sharpe
On Tue, Oct 16, 2018 at 8:24 AM Richard Sharpe wrote: > > Hi folks, > > I have always put a {0, NULL} element on the end of value strings, but > it seems the lua code for constructing value strings when you use > ProtoField(..., some_value_string) does not terminate the list with an > empty