[glib/glib-2-48] gfileutils: Fix a signed/unsigned integer comparison
- From: Matthias Clasen <matthiasc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [glib/glib-2-48] gfileutils: Fix a signed/unsigned integer comparison
- Date: Wed, 17 Aug 2016 21:39:27 +0000 (UTC)
commit 2334bc599237306163b08328ae821c035743baa1
Author: Philip Withnall <philip withnall collabora co uk>
Date: Thu Nov 27 09:09:01 2014 +0000
gfileutils: Fix a signed/unsigned integer comparison
Also use size_t rather than int, allowing for larger files to be
handled.
https://bugzilla.gnome.org/show_bug.cgi?id=700756
glib/gfileutils.c | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/glib/gfileutils.c b/glib/gfileutils.c
index 31a84cf..67d315a 100644
--- a/glib/gfileutils.c
+++ b/glib/gfileutils.c
@@ -2021,8 +2021,8 @@ g_file_read_link (const gchar *filename,
{
#ifdef HAVE_READLINK
gchar *buffer;
- guint size;
- gint read_size;
+ size_t size;
+ ssize_t read_size;
size = 256;
buffer = g_malloc (size);
@@ -2041,7 +2041,7 @@ g_file_read_link (const gchar *filename,
return NULL;
}
- if (read_size < size)
+ if ((size_t) read_size < size)
{
buffer[read_size] = 0;
return buffer;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]