mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-02-02 17:26:17 +01:00
Handle the return value to fwrite properly
This commit is contained in:
parent
4dd500c22a
commit
f3d30afed7
@ -96,6 +96,7 @@ write_out_typelib (gchar *prefix,
|
||||
GTypelib *typelib)
|
||||
{
|
||||
FILE *file;
|
||||
gsize written;
|
||||
|
||||
if (output == NULL)
|
||||
{
|
||||
@ -127,7 +128,14 @@ write_out_typelib (gchar *prefix,
|
||||
}
|
||||
|
||||
if (!code)
|
||||
fwrite (typelib->data, 1, typelib->len, file);
|
||||
{
|
||||
written = fwrite (typelib->data, 1, typelib->len, file);
|
||||
if (written < typelib->len) {
|
||||
g_error ("ERROR: Could not write the whole output: %s",
|
||||
strerror(errno));
|
||||
return;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
gchar *code;
|
||||
|
Loading…
Reference in New Issue
Block a user