[gnome-initial-setup] eula: replace strcmp with g_strcmp0 for null safety



commit f20092f92f84bbeb18bca4ed9d23b443d6142025
Author: Michael Wood <michael g wood intel com>
Date:   Thu Jul 18 17:29:22 2013 +0100

    eula: replace strcmp with g_strcmp0 for null safety
    
    When determining the file type make sure that if strrchr returns null we
    don't try to dereference it.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=704484

 gnome-initial-setup/pages/eulas/gis-eula-page.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/gnome-initial-setup/pages/eulas/gis-eula-page.c b/gnome-initial-setup/pages/eulas/gis-eula-page.c
index a54af0e..ae5b13f 100644
--- a/gnome-initial-setup/pages/eulas/gis-eula-page.c
+++ b/gnome-initial-setup/pages/eulas/gis-eula-page.c
@@ -76,9 +76,9 @@ get_file_type (GFile *file)
   path = g_file_get_path (file);
   last_dot = strrchr (path, '.');
 
-  if (strcmp(last_dot, ".txt") == 0)
+  if (g_strcmp0 (last_dot, ".txt") == 0)
     type = TEXT;
-  else if (strcmp (last_dot, ".xml") == 0)
+  else if (g_strcmp0 (last_dot, ".xml") == 0)
     type = MARKUP;
   else
     type = SKIP;


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]