Fix signedness warning in gio/glocalfileinfo.c:read_link()

gio/glocalfileinfo.c: In function ‘read_link’:
gio/glocalfileinfo.c:188:21: error: comparison of integer expressions of different signedness: ‘int’ and ‘guint’ {aka ‘unsigned int’}
  188 |       if (read_size < size)
      |                     ^
This commit is contained in:
Emmanuel Fleury 2020-11-17 21:33:48 +01:00
parent fa248f7f71
commit 4260193cff

View File

@ -170,14 +170,14 @@ read_link (const gchar *full_name)
{
#if defined (HAVE_READLINK)
gchar *buffer;
guint size;
gsize size;
size = 256;
buffer = g_malloc (size);
while (1)
{
int read_size;
gssize read_size;
read_size = readlink (full_name, buffer, size);
if (read_size < 0)
@ -185,7 +185,7 @@ read_link (const gchar *full_name)
g_free (buffer);
return NULL;
}
if (read_size < size)
if ((gsize) read_size < size)
{
buffer[read_size] = 0;
return buffer;