/* Call memcmp after checking if enough chars left, returning 0 if it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1.  */
gint tvb_memeql(tvbuff_t *tvb, const gint offset, const guint8 *str, size_t size)
/* Call memcmp after checking if enough chars left, returning 0 if it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1.  */
gint tvb_memeql(tvbuff_t *tvb, const gint offset, const guint8 *str, size_t size)
{
	const guint8 *ptr;
	ptr = ensure_contiguous_no_exception(tvb, offset, (gint) size, NULL);
	if (ptr) {
		int cmp = memcmp(ptr, str, size);
		return (cmp == 0 ? 0 : -1);
	} else {
		return -1;
	}
}