/* Also, this one allows a length of -1 to mean get all, but does not allow a negative offset.  */
static guint8 * tvb_get_raw_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint length)
/* Also, this one allows a length of -1 to mean get all, but does not allow a negative offset.  */
static guint8 * tvb_get_raw_string(wmem_allocator_t *scope, tvbuff_t *tvb, const gint offset, const gint length)
{
	guint8 *strbuf;
	gint    abs_length = length;
	DISSECTOR_ASSERT(offset     >=  0);
	DISSECTOR_ASSERT(abs_length >= -1);
	if (abs_length < 0)
		abs_length = tvb->length - offset;
	tvb_ensure_bytes_exist(tvb, offset, abs_length);
	strbuf = (guint8 *)wmem_alloc(scope, abs_length + 1);
	tvb_memcpy(tvb, strbuf, offset, abs_length);
	strbuf[abs_length] = '\0';
	return strbuf;
}