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>
This commit is contained in:
Guy Harris 2019-07-20 11:36:29 -07:00
parent 3f5ed14607
commit ff3122a660
1 changed files with 9 additions and 1 deletions

View File

@ -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.