Wireshark mailing list archives

Re: string manipulation


From: Guy Harris <guy () alum mit edu>
Date: Mon, 25 Jan 2010 13:50:54 -0800


On Jan 25, 2010, at 1:31 PM, Gerald Combs wrote:

Assuming hf_helen_flowname is an FT_STRING, couldn't you dispense with
the string-fetching and ptr-tracking entirely and just use

   proto_tree_add_item(helen_sub_tree, hf_helen_flowname, tvb,
       offset, 8, FALSE);

?

It looks as if it's a zero-padded string; that will happen to work currently, as string values are null-terminated and 
if there are any padding bytes, the first of them will terminate the string.

We might want to have an FT_STRINGZPAD type, to make it clear that some fields are zero-padded rather than counted or 
null-terminated.
___________________________________________________________________________
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: