[Xfce4-commits] [apps/xfce4-screensaver] 01/01: Fix CID 213283: Unchecked return value

noreply at xfce.org noreply at xfce.org
Fri Jun 7 04:51:39 CEST 2019


This is an automated email from the git hooks/post-receive script.

b   l   u   e   s   a   b   r   e       p   u   s   h   e   d       a       c   o   m   m   i   t       t   o       b   r   a   n   c   h       m   a   s   t   e   r   
   in repository apps/xfce4-screensaver.

commit dac16b78fdbee08bbf545c5d9fa8e352d0a332d1
Author: Sean Davis <smd.seandavis at gmail.com>
Date:   Thu Jun 6 22:51:33 2019 -0400

    Fix CID 213283: Unchecked return value
---
 savers/floaters.c | 20 +++++++++++++-------
 1 file changed, 13 insertions(+), 7 deletions(-)

diff --git a/savers/floaters.c b/savers/floaters.c
index cedb58f..39c5216 100644
--- a/savers/floaters.c
+++ b/savers/floaters.c
@@ -1105,7 +1105,8 @@ main (int   argc,
     ScreenSaver     *screen_saver;
     GtkWidget       *window;
     GtkWidget       *drawing_area;
-    GError *error;
+    GError          *error;
+    gboolean         success;
 
     error = NULL;
 
@@ -1113,12 +1114,12 @@ main (int   argc,
     bind_textdomain_codeset (GETTEXT_PACKAGE, "UTF-8");
     textdomain (GETTEXT_PACKAGE);
 
-    gtk_init_with_args (&argc, &argv,
-                        /* translators: the word "image" here
-                         * represents a command line argument
-                         */
-                        _("image - floats images around the screen"),
-                        options, GETTEXT_PACKAGE, &error);
+    success = gtk_init_with_args (&argc, &argv,
+                                  /* translators: the word "image" here
+                                  * represents a command line argument
+                                  */
+                                  _("image - floats images around the screen"),
+                                  options, GETTEXT_PACKAGE, &error);
 
     if (error != NULL) {
         g_printerr (_("%s. See --help for usage information.\n"),
@@ -1127,6 +1128,11 @@ main (int   argc,
         return EX_SOFTWARE;
     }
 
+    if (!success) {
+        g_printerr (_("Failed to initialize the windowing system."));
+        return EX_SOFTWARE;
+    }
+
     if ((filenames == NULL) || (filenames[0] == NULL) ||
             (filenames[1] != NULL)) {
         g_printerr (_("You must specify one image.  See --help for usage "

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.


More information about the Xfce4-commits mailing list