[Xfce4-commits] <xfce4-xkb-plugin:master> Add more safety checking.

Jérôme Guelfucci noreply at xfce.org
Fri Apr 29 00:34:02 CEST 2011


Updating branch refs/heads/master
         to 0c62d39ae74560e7e50daba4ab57edc1832d5ad2 (commit)
       from 6e173f2530d65d5c4820997739f62676caf2d065 (commit)

commit 0c62d39ae74560e7e50daba4ab57edc1832d5ad2
Author: Jérôme Guelfucci <jeromeg at xfce.org>
Date:   Thu Apr 28 23:38:00 2011 +0200

    Add more safety checking.

 panel-plugin/xkb-util.c |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/panel-plugin/xkb-util.c b/panel-plugin/xkb-util.c
index 360424e..34d0c15 100644
--- a/panel-plugin/xkb-util.c
+++ b/panel-plugin/xkb-util.c
@@ -35,7 +35,8 @@ xkb_util_get_flag_filename (gchar* group_name)
 {
     gchar* filename;
 
-    g_assert (group_name != NULL);
+    if (!group_name)
+        return NULL;
 
     filename = g_strconcat (FLAGSDIR, "/", group_name, ".svg", NULL);
 
@@ -47,7 +48,10 @@ xkb_util_get_layout_string (gchar *group_name, gchar *variant)
 {
     gchar *layout;
 
-    if (strlen (variant) > 0)
+    if (!group_name)
+        return NULL;
+
+    if (variant && strlen (variant) > 0)
     {
         layout = g_strconcat (group_name, " (", variant, ")", NULL);
     }
@@ -69,9 +73,7 @@ xkb_util_normalize_group_name (gchar* group_name)
     gint index_tmp = -1;
 
     if (!group_name)
-    {
         return NULL;
-    }
 
     if (strlen (group_name) <= 3)
     {



More information about the Xfce4-commits mailing list