aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2005-09-05 21:18:06 +0000
committerGuy Harris <guy@alum.mit.edu>2005-09-05 21:18:06 +0000
commitaeb8645a56c669aa3a3dc8b436265c8d610e9881 (patch)
tree3d762bb5da33c5eccfb8ed9cc5651d92565ea442 /epan/ftypes
parentcc9423a0d882e2866463dacc74c6f9fbdea019b0 (diff)
"strlen()" returns a "size_t"; use that for its return value.
Cast the argument to <ctype.h> macros to "guchar", so that if the 8th bit is set in the byte, it doesn't get sign-extended. svn path=/trunk/; revision=15691
Diffstat (limited to 'epan/ftypes')
-rw-r--r--epan/ftypes/ftype-bytes.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/epan/ftypes/ftype-bytes.c b/epan/ftypes/ftype-bytes.c
index aed1d1b0e8..885f88884c 100644
--- a/epan/ftypes/ftype-bytes.c
+++ b/epan/ftypes/ftype-bytes.c
@@ -77,7 +77,7 @@ bytes_repr_len(fvalue_t *fv, ftrepr_t rtype _U_)
}
static int
-guid_repr_len(fvalue_t *fv, ftrepr_t rtype _U_)
+guid_repr_len(fvalue_t *fv _U_, ftrepr_t rtype _U_)
{
return GUID_STR_LEN;
}
@@ -241,17 +241,20 @@ ipv6_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogF
static gboolean
get_guid(char *s, guint8 *buf)
{
- int i, n;
+ size_t i, n;
char *p, two_digits[3];
static const char fmt[] = "XXXXXXXX-XXXX-XXXX-XXXX-XXXXXXXXXXXX";
n = strlen(s);
- if (n != strlen(fmt)) return FALSE;
+ if (n != strlen(fmt))
+ return FALSE;
for (i=0; i<n; i++) {
if (fmt[i] == 'X') {
- if (!isxdigit(s[i])) return FALSE;
+ if (!isxdigit((guchar)s[i]))
+ return FALSE;
} else {
- if (s[i] != fmt[i]) return FALSE;
+ if (s[i] != fmt[i])
+ return FALSE;
}
}
for (p=s,i=0; i<GUID_LEN; i++) {