diff options
author | Guy Harris <guy@alum.mit.edu> | 2004-02-01 21:30:17 +0000 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2004-02-01 21:30:17 +0000 |
commit | 87b219554ea7dd1c88d90d1b1961d57cdba0f5bc (patch) | |
tree | 2756d8488627df166d28cc7a4acb9d5e51678ba4 | |
parent | 650a8c3100afe642bc8b2299cb64c13db1272483 (diff) |
Make "tvb_strneql()" take a "gchar *" rather than a "guint8 *" as the
string argument.
Add some casts to squelch compiler warnings.
svn path=/trunk/; revision=9951
-rw-r--r-- | epan/tvbuff.c | 12 | ||||
-rw-r--r-- | epan/tvbuff.h | 4 |
2 files changed, 8 insertions, 8 deletions
diff --git a/epan/tvbuff.c b/epan/tvbuff.c index a3ff20f390..317eef217f 100644 --- a/epan/tvbuff.c +++ b/epan/tvbuff.c @@ -9,7 +9,7 @@ * the data of a backing tvbuff, or can be a composite of * other tvbuffs. * - * $Id: tvbuff.c,v 1.58 2004/02/01 06:49:24 jmayer Exp $ + * $Id: tvbuff.c,v 1.59 2004/02/01 21:30:17 guy Exp $ * * Copyright (c) 2000 by Gilbert Ramirez <gram@alumni.rice.edu> * @@ -1518,14 +1518,14 @@ tvb_strnlen(tvbuff_t *tvb, gint offset, guint maxlength) * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1. */ gint -tvb_strneql(tvbuff_t *tvb, gint offset, const guint8 *str, gint size) +tvb_strneql(tvbuff_t *tvb, gint offset, const gchar *str, gint size) { guint8 *ptr; ptr = ensure_contiguous_no_exception(tvb, offset, size, NULL); if (ptr) { - int cmp = strncmp(ptr, str, size); + int cmp = strncmp((char *)ptr, str, size); /* * Return 0 if equal, -1 otherwise. @@ -1552,7 +1552,7 @@ tvb_strncaseeql(tvbuff_t *tvb, gint offset, const gchar *str, gint size) ptr = ensure_contiguous_no_exception(tvb, offset, size, NULL); if (ptr) { - int cmp = strncasecmp(ptr, str, size); + int cmp = strncasecmp((char *)ptr, str, size); /* * Return 0 if equal, -1 otherwise. @@ -1856,7 +1856,7 @@ tvb_find_line_end(tvbuff_t *tvb, gint offset, int len, gint *next_offset, /* * Look either for a CR or an LF. */ - eol_offset = tvb_pbrk_guint8(tvb, offset, len, "\r\n"); + eol_offset = tvb_pbrk_guint8(tvb, offset, len, (guint8 *)"\r\n"); if (eol_offset == -1) { /* * No CR or LF - line is presumably continued in next packet. @@ -1985,7 +1985,7 @@ tvb_find_line_end_unquoted(tvbuff_t *tvb, gint offset, int len, * Look either for a CR, an LF, or a '"'. */ char_offset = tvb_pbrk_guint8(tvb, cur_offset, len, - "\r\n\""); + (guint8 *)"\r\n\""); } if (char_offset == -1) { /* diff --git a/epan/tvbuff.h b/epan/tvbuff.h index 9a707dfef5..f999be3245 100644 --- a/epan/tvbuff.h +++ b/epan/tvbuff.h @@ -9,7 +9,7 @@ * the data of a backing tvbuff, or can be a composite of * other tvbuffs. * - * $Id: tvbuff.h,v 1.38 2004/02/01 06:49:24 jmayer Exp $ + * $Id: tvbuff.h,v 1.39 2004/02/01 21:30:17 guy Exp $ * * Copyright (c) 2000 by Gilbert Ramirez <gram@alumni.rice.edu> * @@ -474,7 +474,7 @@ extern gint tvb_find_line_end_unquoted(tvbuff_t *tvb, gint offset, int len, * Call strncmp after checking if enough chars left, returning 0 if * it returns 0 (meaning "equal") and -1 otherwise, otherwise return -1. */ -extern gint tvb_strneql(tvbuff_t *tvb, gint offset, const guint8 *str, +extern gint tvb_strneql(tvbuff_t *tvb, gint offset, const gchar *str, gint size); /* |