mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-05-18 19:51:57 +02:00
Fix signedness warning in gio/gsimpleproxyresolver.c:ignore_host()
gio/gsimpleproxyresolver.c: In function ‘ignore_host’: gio/gsimpleproxyresolver.c:271:18: error: comparison of integer expressions of different signedness: ‘gint’ {aka ‘int’} and ‘guint’ {aka ‘unsigned int’} 271 | for (i = 0; i < priv->ignore_ips->len; i++) | ^
This commit is contained in:
parent
a39312b14f
commit
8b4c6fcc00
@ -50,7 +50,7 @@
|
|||||||
|
|
||||||
typedef struct {
|
typedef struct {
|
||||||
gchar *name;
|
gchar *name;
|
||||||
gint length;
|
gsize length;
|
||||||
gushort port;
|
gushort port;
|
||||||
} GSimpleProxyResolverDomain;
|
} GSimpleProxyResolverDomain;
|
||||||
|
|
||||||
@ -259,7 +259,8 @@ ignore_host (GSimpleProxyResolver *resolver,
|
|||||||
GSimpleProxyResolverPrivate *priv = resolver->priv;
|
GSimpleProxyResolverPrivate *priv = resolver->priv;
|
||||||
gchar *ascii_host = NULL;
|
gchar *ascii_host = NULL;
|
||||||
gboolean ignore = FALSE;
|
gboolean ignore = FALSE;
|
||||||
gint i, length, offset;
|
gsize offset, length;
|
||||||
|
guint i;
|
||||||
|
|
||||||
if (priv->ignore_ips)
|
if (priv->ignore_ips)
|
||||||
{
|
{
|
||||||
@ -297,6 +298,9 @@ ignore_host (GSimpleProxyResolver *resolver,
|
|||||||
{
|
{
|
||||||
GSimpleProxyResolverDomain *domain = &priv->ignore_domains[i];
|
GSimpleProxyResolverDomain *domain = &priv->ignore_domains[i];
|
||||||
|
|
||||||
|
if (domain->length > length)
|
||||||
|
continue;
|
||||||
|
|
||||||
offset = length - domain->length;
|
offset = length - domain->length;
|
||||||
if ((domain->port == 0 || domain->port == port) &&
|
if ((domain->port == 0 || domain->port == port) &&
|
||||||
(offset == 0 || (offset > 0 && host[offset - 1] == '.')) &&
|
(offset == 0 || (offset > 0 && host[offset - 1] == '.')) &&
|
||||||
|
Loading…
x
Reference in New Issue
Block a user