mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-12 07:26:15 +01:00
Fix signedness in glib/gmappedfile.c
glib/gmappedfile.c: In function ‘mapped_file_new_from_fd’: glib/gmappedfile.c:153:18: error: comparison of integer expressions of different signedness: ‘__off_t’ {aka ‘long int’} and ‘long unsigned int’ [-Werror=sign-compare] if (st.st_size > G_MAXSIZE) ^
This commit is contained in:
parent
2f9e6e977a
commit
8eae303da0
@ -150,7 +150,7 @@ mapped_file_new_from_fd (int fd,
|
||||
file->contents = MAP_FAILED;
|
||||
|
||||
#ifdef HAVE_MMAP
|
||||
if (st.st_size > G_MAXSIZE)
|
||||
if (sizeof (st.st_size) > sizeof (gsize) && st.st_size > (off_t) G_MAXSIZE)
|
||||
{
|
||||
errno = EINVAL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user