aboutsummaryrefslogtreecommitdiffstats
path: root/epan/ftypes
diff options
context:
space:
mode:
authorGuy Harris <guy@alum.mit.edu>2019-07-20 11:36:29 -0700
committerGuy Harris <guy@alum.mit.edu>2019-07-20 19:02:34 +0000
commitff3122a660a582e862f2ce1000f57c6e0787858e (patch)
tree6c62c7d10c2fea5786c0eca48cfd4f395e42d445 /epan/ftypes
parent3f5ed14607fed968ebf464ef45b8dfc9a7a09f87 (diff)
Fix -Wpointer-sign warning.
Change-Id: I8e74e90f1383f01633343cd6e72ac2193bfb3e04 Reviewed-on: https://code.wireshark.org/review/34029 Petri-Dish: Guy Harris <guy@alum.mit.edu> Tested-by: Petri Dish Buildbot Reviewed-by: Guy Harris <guy@alum.mit.edu>
Diffstat (limited to 'epan/ftypes')
-rw-r--r--epan/ftypes/ftype-integer.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/epan/ftypes/ftype-integer.c b/epan/ftypes/ftype-integer.c
index 9c2255eecd..500b4b9717 100644
--- a/epan/ftypes/ftype-integer.c
+++ b/epan/ftypes/ftype-integer.c
@@ -285,14 +285,22 @@ sint_from_unparsed(fvalue_t *fv, const char *s, gboolean allow_partial_value _U_
gint32 max, gint32 min)
{
long value;
+ unsigned long charvalue;
char *endptr;
if (s[0] == '\'') {
/*
* Represented as a C-style character constant.
*/
- if (!parse_charconst(s, &value, err_msg))
+ if (!parse_charconst(s, &charvalue, err_msg))
return FALSE;
+
+ /*
+ * The FT_CHAR type is defined to be signed, regardless
+ * of whether char is signed or unsigned, so cast the value
+ * to "signed char".
+ */
+ value = (signed char)charvalue;
} else {
/*
* Try to parse it as a number.