From 46912d783493962856b2ce4095496455fad62729 Mon Sep 17 00:00:00 2001 From: Hao Lee Date: Tue, 11 Apr 2017 20:58:49 +0800 Subject: Bug Fix: g_get_real_name will never return NULL pointer The function g_get_real_name is used to get user's full name, but when the full name is not existed, it will return an empty string instead of NULL. --- src/gs-lock-plug.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gs-lock-plug.c b/src/gs-lock-plug.c index 99fc547..4069b11 100644 --- a/src/gs-lock-plug.c +++ b/src/gs-lock-plug.c @@ -1595,7 +1595,8 @@ get_user_display_name (void) name = g_get_real_name (); - if (name == NULL || strcmp (name, "Unknown") == 0) + if (name == NULL || g_strcmp0 (name, "") == 0 || + g_strcmp0 (name, "Unknown") == 0) { name = g_get_user_name (); } -- cgit v1.2.1