summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHao Lee <[email protected]>2017-04-11 20:58:49 +0800
committermonsta <[email protected]>2017-04-15 20:57:56 +0300
commit46912d783493962856b2ce4095496455fad62729 (patch)
tree409bcaffe36d6d2dfb2ed340a32b6fe688cc6612 /src
parentd28d6937eeeef8a24138ef9055a8f6794267c0a4 (diff)
downloadmate-screensaver-46912d783493962856b2ce4095496455fad62729.tar.bz2
mate-screensaver-46912d783493962856b2ce4095496455fad62729.tar.xz
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.
Diffstat (limited to 'src')
-rw-r--r--src/gs-lock-plug.c3
1 files changed, 2 insertions, 1 deletions
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 ();
}