mirror of
https://gitlab.gnome.org/GNOME/glib.git
synced 2025-01-23 20:46:14 +01:00
Silence compiler warnings
Fix several warnings for format strings (-Werror=format-security) and set but unused variables (-Wunused-but-set-variable) https://bugzilla.gnome.org/show_bug.cgi?id=664144
This commit is contained in:
parent
fcffe6abbb
commit
216fd8a82c
@ -64,7 +64,6 @@ gint main (gint argc, gchar * argv[])
|
||||
gsize length_out;
|
||||
const gchar encoding[] = "EUC-JP";
|
||||
GIOStatus status;
|
||||
GIOFlags flags;
|
||||
|
||||
if (!srcdir)
|
||||
srcdir = ".";
|
||||
@ -90,7 +89,7 @@ gint main (gint argc, gchar * argv[])
|
||||
g_io_channel_set_encoding (gio_r, encoding, &gerr);
|
||||
if (gerr)
|
||||
{
|
||||
g_warning (gerr->message);
|
||||
g_warning ("%s", gerr->message);
|
||||
/* Keep going if this is just a case of iconv not supporting EUC-JP, see bug 428048 */
|
||||
if (gerr->code != G_CONVERT_ERROR_NO_CONVERSION)
|
||||
return 1;
|
||||
@ -103,11 +102,10 @@ gint main (gint argc, gchar * argv[])
|
||||
status = g_io_channel_set_flags (gio_r, G_IO_FLAG_NONBLOCK, &gerr);
|
||||
if (status == G_IO_STATUS_ERROR)
|
||||
{
|
||||
g_warning (gerr->message);
|
||||
g_warning ("%s", gerr->message);
|
||||
g_error_free (gerr);
|
||||
gerr = NULL;
|
||||
}
|
||||
flags = g_io_channel_get_flags (gio_r);
|
||||
buffer = g_string_sized_new (BUFFER_SIZE);
|
||||
|
||||
while (TRUE)
|
||||
@ -143,7 +141,7 @@ gint main (gint argc, gchar * argv[])
|
||||
case G_IO_STATUS_EOF:
|
||||
break;
|
||||
case G_IO_STATUS_ERROR:
|
||||
g_warning (gerr->message);
|
||||
g_warning ("%s", gerr->message);
|
||||
g_error_free (gerr);
|
||||
gerr = NULL;
|
||||
break;
|
||||
@ -158,7 +156,7 @@ gint main (gint argc, gchar * argv[])
|
||||
|
||||
if (status == G_IO_STATUS_ERROR)
|
||||
{
|
||||
g_warning (gerr->message);
|
||||
g_warning ("%s", gerr->message);
|
||||
g_error_free (gerr);
|
||||
gerr = NULL;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user