[gnome-initial-setup/gnome-3-8] eula: replace strcmp with g_strcmp0 for null safety
- From: Michael Wood <mwood src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-initial-setup/gnome-3-8] eula: replace strcmp with g_strcmp0 for null safety
- Date: Fri, 19 Jul 2013 14:21:16 +0000 (UTC)
commit f1de180748d2b3a69a69538eb47def37ae415658
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]