Wireshark mailing list archives
Re: Best way to handle a variable-length NULL-terminated string in a tvb
From: "Maynard, Chris" <Christopher.Maynard () GTECH COM>
Date: Mon, 3 May 2010 11:32:51 -0400
Maybe this is what you're looking for?
From epan/tvbuff.h:
/** Find size of stringz (NUL-terminated string) by looking for terminating * NUL. The size of the string includes the terminating NUL. * * If the NUL isn't found, it throws the appropriate exception. */ extern guint tvb_strsize(tvbuff_t *tvb, const gint offset); - Chris -----Original Message----- From: wireshark-dev-bounces () wireshark org [mailto:wireshark-dev-bounces () wireshark org] On Behalf Of Jeremy O'Brien Sent: Monday, May 03, 2010 11:14 AM To: Developer support list for Wireshark Subject: Re: [Wireshark-dev] Best way to handle a variable-length NULL-terminated string in a tvb Actually, is there a function that will just get the length of said string? I don't need to do anything with the string itself other than add it to the proto_tree and of course increment my offset. I know I could just g_free the string immediately after fetching it, but this seems like it has a little overhead. [snip] CONFIDENTIALITY NOTICE: The contents of this email are confidential and for the exclusive use of the intended recipient. If you receive this email in error, please delete it from your system immediately and notify us either by email, telephone or fax. You should not copy, forward, or otherwise disclose the content of the email. ___________________________________________________________________________ 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:
- Re: Best way to handle a variable-length NULL-terminated string in a tvb Jeremy O'Brien (May 03)
- Re: Best way to handle a variable-length NULL-terminated string in a tvb Jeremy O'Brien (May 03)
- Re: Best way to handle a variable-length NULL-terminated string in a tvb Maynard, Chris (May 03)
- Re: Best way to handle a variable-length NULL-terminated string in a tvb Jeremy O'Brien (May 08)
- Re: Best way to handle a variable-length NULL-terminated string in a tvb Stephen Fisher (May 03)
- Re: Best way to handle a variable-length NULL-terminated string in a tvb Maynard, Chris (May 03)
- Re: Best way to handle a variable-length NULL-terminated string in a tvb Guy Harris (May 03)
- Re: Best way to handle a variable-length NULL-terminated string in a tvb Jeremy O'Brien (May 03)