From 48e69b9b4f706c2f7d1e3984ecf88b76a3f3487e Mon Sep 17 00:00:00 2001 From: guy Date: Sun, 15 Mar 2009 02:57:16 +0000 Subject: Some more P64 fixes - they all assume we don't have truly gigantic strings. git-svn-id: http://anonsvn.wireshark.org/wireshark/trunk@27720 f5534014-38df-0310-8fa8-9805f1628bb7 --- epan/ftypes/ftype-bytes.c | 2 +- epan/ftypes/ftype-string.c | 4 ++-- epan/ftypes/ftype-time.c | 6 +++--- epan/ftypes/ftype-tvbuff.c | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) (limited to 'epan') diff --git a/epan/ftypes/ftype-bytes.c b/epan/ftypes/ftype-bytes.c index 38cbb28253..19f2ba0eda 100644 --- a/epan/ftypes/ftype-bytes.c +++ b/epan/ftypes/ftype-bytes.c @@ -189,7 +189,7 @@ bytes_from_string(fvalue_t *fv, char *s, LogFunc logfunc _U_) bytes = g_byte_array_new(); - g_byte_array_append(bytes, (guint8 *)s, strlen(s)); + g_byte_array_append(bytes, (guint8 *)s, (guint)strlen(s)); /* Free up the old value, if we have one */ bytes_fvalue_free(fv); diff --git a/epan/ftypes/ftype-string.c b/epan/ftypes/ftype-string.c index 0e60bc2a2a..742400fe26 100644 --- a/epan/ftypes/ftype-string.c +++ b/epan/ftypes/ftype-string.c @@ -68,7 +68,7 @@ string_repr_len(fvalue_t *fv, ftrepr_t rtype) switch (rtype) { case FTREPR_DISPLAY: - return strlen(fv->value.string); + return (int)strlen(fv->value.string); case FTREPR_DFILTER: repr_len = 0; for (p = fv->value.string; (c = *p) != '\0'; p++) { @@ -182,7 +182,7 @@ val_from_unparsed(fvalue_t *fv, char *s, gboolean allow_partial_value _U_, LogFu static guint len(fvalue_t *fv) { - return strlen(fv->value.string); + return (guint)strlen(fv->value.string); } static void diff --git a/epan/ftypes/ftype-time.c b/epan/ftypes/ftype-time.c index ed50e3b160..ed06b47ba7 100644 --- a/epan/ftypes/ftype-time.c +++ b/epan/ftypes/ftype-time.c @@ -124,7 +124,7 @@ get_nsecs(char *startp, int *nsecs) /* * How many characters are in the string? */ - ndigits = strlen(startp); + ndigits = (int)strlen(startp); /* * If there are N characters in the string, the last of the @@ -319,7 +319,7 @@ absolute_val_repr_len(fvalue_t *fv, ftrepr_t rtype _U_) gchar *rep; rep = abs_time_to_str(&fv->value.time); - return strlen(rep) + 2; /* 2 for opening and closing quotes */ + return (int)strlen(rep) + 2; /* 2 for opening and closing quotes */ } static void @@ -334,7 +334,7 @@ relative_val_repr_len(fvalue_t *fv, ftrepr_t rtype _U_) gchar *rep; rep = rel_time_to_secs_str(&fv->value.time); - return strlen(rep); + return (int)strlen(rep); } static void diff --git a/epan/ftypes/ftype-tvbuff.c b/epan/ftypes/ftype-tvbuff.c index 135de1d0be..bd81508bd1 100644 --- a/epan/ftypes/ftype-tvbuff.c +++ b/epan/ftypes/ftype-tvbuff.c @@ -79,9 +79,9 @@ val_from_string(fvalue_t *fv, char *s, LogFunc logfunc _U_) /* Make a tvbuff from the string. We can drop the * terminating NUL. */ - private_data = g_memdup(s, strlen(s)); + private_data = g_memdup(s, (guint)strlen(s)); new_tvb = tvb_new_real_data(private_data, - strlen(s), strlen(s)); + (guint)strlen(s), (gint)strlen(s)); /* Let the tvbuff know how to delete the data. */ tvb_set_free_cb(new_tvb, free_tvb_data); -- cgit v1.2.3