forked from osmocom/wireshark
strtol() returns a long, as the name suggests; assign its return value
to a long, and check whether it fits in a gint before returning it as a gint. svn path=/trunk/; revision=25418
This commit is contained in:
parent
2ad3cb9bba
commit
710ffd067b
|
@ -101,7 +101,7 @@ gint
|
|||
capture_dev_user_linktype_find(const gchar *if_name)
|
||||
{
|
||||
gchar *p, *next;
|
||||
gint linktype;
|
||||
long linktype;
|
||||
|
||||
if (prefs.capture_devices_linktypes == NULL) {
|
||||
/* There are no link-layer header types */
|
||||
|
@ -119,8 +119,12 @@ capture_dev_user_linktype_find(const gchar *if_name)
|
|||
/* Syntax error */
|
||||
return -1;
|
||||
}
|
||||
if (linktype > G_MAXINT) {
|
||||
/* Value doesn't fit in a gint */
|
||||
return -1;
|
||||
}
|
||||
|
||||
return linktype;
|
||||
return (gint)linktype;
|
||||
}
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue