mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-04-13 19:23:07 +02:00
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
This commit is contained in:
parent
ae048625fe
commit
c91411464e
@ -2026,8 +2026,8 @@ g_file_read_link (const gchar *filename,
|
|||||||
{
|
{
|
||||||
#ifdef HAVE_READLINK
|
#ifdef HAVE_READLINK
|
||||||
gchar *buffer;
|
gchar *buffer;
|
||||||
guint size;
|
size_t size;
|
||||||
gint read_size;
|
ssize_t read_size;
|
||||||
|
|
||||||
size = 256;
|
size = 256;
|
||||||
buffer = g_malloc (size);
|
buffer = g_malloc (size);
|
||||||
@ -2046,7 +2046,7 @@ g_file_read_link (const gchar *filename,
|
|||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (read_size < size)
|
if ((size_t) read_size < size)
|
||||||
{
|
{
|
||||||
buffer[read_size] = 0;
|
buffer[read_size] = 0;
|
||||||
return buffer;
|
return buffer;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user