From 4260193cff934e55cfe2903a4339c86a6d6d683e Mon Sep 17 00:00:00 2001 From: Emmanuel Fleury Date: Tue, 17 Nov 2020 21:33:48 +0100 Subject: [PATCH] Fix signedness warning in gio/glocalfileinfo.c:read_link() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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) | ^ --- gio/glocalfileinfo.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c index 4228d3457..94de17057 100644 --- a/gio/glocalfileinfo.c +++ b/gio/glocalfileinfo.c @@ -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;