From c1ccc5d7567eb40ddcbf5d5eafc3d682435da335 Mon Sep 17 00:00:00 2001 From: Andre Miranda Date: Sat, 23 Jan 2016 12:05:55 -0300 Subject: [PATCH] Fix core dumps with invalid command line option --- mousepad/main.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/mousepad/main.c b/mousepad/main.c index da25e7a..88cf75b 100644 --- a/mousepad/main.c +++ b/mousepad/main.c @@ -87,12 +87,12 @@ main (gint argc, gchar **argv) if (G_LIKELY (error == NULL)) { /* no error message, the gui initialization failed */ - g_error ("%s", _("Failed to open display.")); + g_printerr ("%s\n", _("Failed to open display.")); } else { /* print the error message */ - g_error ("%s", error->message); + g_printerr ("%s\n", error->message); g_error_free (error); } @@ -118,7 +118,7 @@ main (gint argc, gchar **argv) /* try to terminate whatever is running */ if (!mousepad_dbus_client_terminate (&error)) { - g_error ("Failed to terminate a running instance: %s\n", error->message); + g_printerr ("Failed to terminate a running instance: %s\n", error->message); g_error_free (error); return EXIT_FAILURE; } @@ -146,7 +146,7 @@ main (gint argc, gchar **argv) /* print errors, if needed */ if (G_UNLIKELY (error)) { - g_error ("Mousepad: %s\n", error->message); + g_printerr ("Mousepad: %s\n", error->message); g_error_free (error); return EXIT_FAILURE; -- 2.7.0