Wireshark-dev: Re: [Wireshark-dev] Best way to handle a variable-length NULL-terminated string
From: Jeremy O'Brien <obrien654j@xxxxxxxxx>
Date: Sat, 8 May 2010 17:57:40 -0400
On May 3, 2010, at 11:32 AM, Maynard, Chris wrote:

> 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);

Even better. I was doing a g_free(tvb_get_stringz(tvb, offset, &length)); before. This saves me the trouble and the overhead. Thanks!