From 0a10f7375f7e6ff80fea8eec83d8faf36da1b4bc Mon Sep 17 00:00:00 2001 From: Philip Withnall Date: Thu, 5 Oct 2017 13:31:10 +0100 Subject: [PATCH] glocalfileinfo: Use g_strcmp0() for some comparisons which might be NULL The return value from g_get_user_special_dir() might be NULL. Safest to use g_strcmp0() uniformly everywhere. Signed-off-by: Philip Withnall https://bugzilla.gnome.org/show_bug.cgi?id=661442 --- gio/glocalfileinfo.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/gio/glocalfileinfo.c b/gio/glocalfileinfo.c index 1c97eef59..a46a842f0 100644 --- a/gio/glocalfileinfo.c +++ b/gio/glocalfileinfo.c @@ -1618,12 +1618,12 @@ get_icon_name (const char *path, const char *name = NULL; gboolean with_fallbacks = TRUE; - if (strcmp (path, g_get_home_dir ()) == 0) + if (g_strcmp0 (path, g_get_home_dir ()) == 0) { name = use_symbolic ? "user-home-symbolic" : "user-home"; with_fallbacks = FALSE; } - else if (strcmp (path, g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP)) == 0) + else if (g_strcmp0 (path, g_get_user_special_dir (G_USER_DIRECTORY_DESKTOP)) == 0) { name = use_symbolic ? "user-desktop-symbolic" : "user-desktop"; with_fallbacks = FALSE;