Make tvb_strncaseeql()'s size parameter be a size_t. Cast the size to int before calling ensure_contiguous_no_exception() (also in tvb_strneql()).

svn path=/trunk/; revision=34727
This commit is contained in:
Jeff Morriss 2010-10-30 18:53:31 +00:00
parent af3d0b2bde
commit 0b7e2cd37e
2 changed files with 4 additions and 4 deletions

View File

@ -1986,7 +1986,7 @@ tvb_strneql(tvbuff_t *tvb, const gint offset, const gchar *str, const size_t siz
{
const guint8 *ptr;
ptr = ensure_contiguous_no_exception(tvb, offset, size, NULL);
ptr = ensure_contiguous_no_exception(tvb, offset, (gint)size, NULL);
if (ptr) {
int cmp = strncmp((const char *)ptr, str, size);
@ -2009,11 +2009,11 @@ tvb_strneql(tvbuff_t *tvb, const gint offset, const gchar *str, const size_t siz
* 0 if it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1.
*/
gint
tvb_strncaseeql(tvbuff_t *tvb, const gint offset, const gchar *str, const gint size)
tvb_strncaseeql(tvbuff_t *tvb, const gint offset, const gchar *str, const size_t size)
{
const guint8 *ptr;
ptr = ensure_contiguous_no_exception(tvb, offset, size, NULL);
ptr = ensure_contiguous_no_exception(tvb, offset, (gint)size, NULL);
if (ptr) {
int cmp = g_ascii_strncasecmp((const char *)ptr, str, size);

View File

@ -624,7 +624,7 @@ extern gint tvb_strneql(tvbuff_t *tvb, const gint offset, const gchar *str,
* 0 if it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1.
*/
extern gint tvb_strncaseeql(tvbuff_t *tvb, const gint offset, const gchar *str,
const gint size);
const size_t size);
/**
* Call memcmp after checking if enough chars left, returning 0 if