mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2024-11-02 15:46:17 +01:00
handle the unlikely case that no bytes are read from the file and allocate
2005-03-30 Sven Neumann <sven@gimp.org> * glib/gfileutils.c (get_contents_stdio): handle the unlikely case that no bytes are read from the file and allocate an empty string.
This commit is contained in:
parent
0f88e05d5b
commit
ec2d35edc3
@ -1,3 +1,8 @@
|
|||||||
|
2005-03-30 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* glib/gfileutils.c (get_contents_stdio): handle the unlikely case
|
||||||
|
that no bytes are read from the file and allocate an empty string.
|
||||||
|
|
||||||
2005-03-30 Tor Lillqvist <tml@novell.com>
|
2005-03-30 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/giowin32.c (g_io_win32_fd_get_flags_internal): Always claim
|
* glib/giowin32.c (g_io_win32_fd_get_flags_internal): Always claim
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2005-03-30 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* glib/gfileutils.c (get_contents_stdio): handle the unlikely case
|
||||||
|
that no bytes are read from the file and allocate an empty string.
|
||||||
|
|
||||||
2005-03-30 Tor Lillqvist <tml@novell.com>
|
2005-03-30 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/giowin32.c (g_io_win32_fd_get_flags_internal): Always claim
|
* glib/giowin32.c (g_io_win32_fd_get_flags_internal): Always claim
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2005-03-30 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* glib/gfileutils.c (get_contents_stdio): handle the unlikely case
|
||||||
|
that no bytes are read from the file and allocate an empty string.
|
||||||
|
|
||||||
2005-03-30 Tor Lillqvist <tml@novell.com>
|
2005-03-30 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/giowin32.c (g_io_win32_fd_get_flags_internal): Always claim
|
* glib/giowin32.c (g_io_win32_fd_get_flags_internal): Always claim
|
||||||
|
@ -1,3 +1,8 @@
|
|||||||
|
2005-03-30 Sven Neumann <sven@gimp.org>
|
||||||
|
|
||||||
|
* glib/gfileutils.c (get_contents_stdio): handle the unlikely case
|
||||||
|
that no bytes are read from the file and allocate an empty string.
|
||||||
|
|
||||||
2005-03-30 Tor Lillqvist <tml@novell.com>
|
2005-03-30 Tor Lillqvist <tml@novell.com>
|
||||||
|
|
||||||
* glib/giowin32.c (g_io_win32_fd_get_flags_internal): Always claim
|
* glib/giowin32.c (g_io_win32_fd_get_flags_internal): Always claim
|
||||||
|
@ -523,6 +523,9 @@ get_contents_stdio (const gchar *display_filename,
|
|||||||
|
|
||||||
fclose (f);
|
fclose (f);
|
||||||
|
|
||||||
|
if (total_bytes == 0)
|
||||||
|
str = g_new (gchar, 1);
|
||||||
|
|
||||||
str[total_bytes] = '\0';
|
str[total_bytes] = '\0';
|
||||||
|
|
||||||
if (length)
|
if (length)
|
||||||
|
Loading…
Reference in New Issue
Block a user