[glib: 1/6] Fix signedness warning in gio/glocalfileinfo.c:read_link()
- From: Philip Withnall <pwithnall src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib: 1/6] Fix signedness warning in gio/glocalfileinfo.c:read_link()
- Date: Tue, 9 Feb 2021 10:45:53 +0000 (UTC)
commit 4260193cff934e55cfe2903a4339c86a6d6d683e
Author: Emmanuel Fleury <emmanuel fleury gmail com>
Date: Tue Nov 17 21:33:48 2020 +0100
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)
| ^
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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]