Fix signedness warning in gio/gunixsocketaddress.c

gio/gunixsocketaddress.c: In function ‘g_unix_socket_address_to_native’:
gio/gunixsocketaddress.c:217:15: error: comparison of integer expressions of different signedness: ‘gsize’ {aka ‘long unsigned int’} and ‘gssize’ {aka ‘long int’}
  217 |   if (destlen < socklen)
      |               ^
This commit is contained in:
Emmanuel Fleury 2020-11-18 20:07:34 +01:00
parent 5fec112453
commit 1f23770bc3

View File

@ -214,7 +214,8 @@ g_unix_socket_address_to_native (GSocketAddress *address,
gssize socklen;
socklen = g_unix_socket_address_get_native_size (address);
if (destlen < socklen)
g_assert (socklen >= 0);
if (destlen < (gsize) socklen)
{
g_set_error_literal (error, G_IO_ERROR, G_IO_ERROR_NO_SPACE,
_("Not enough space for socket address"));