summaryrefslogtreecommitdiff
path: root/src/gs-lock-plug.c
diff options
context:
space:
mode:
authorHao Lee <[email protected]>2017-04-11 20:58:49 +0800
committerraveit65 <[email protected]>2017-04-15 13:58:59 +0200
commit14db5d0087d5b519adb87abaa3f4825a448d88a8 (patch)
tree88ad2e272c17bc5b0316b4e64360f3f9d3edba5a /src/gs-lock-plug.c
parent6ed40a06cd7fc6d70842fa386e6612e71e291ab9 (diff)
downloadmate-screensaver-14db5d0087d5b519adb87abaa3f4825a448d88a8.tar.bz2
mate-screensaver-14db5d0087d5b519adb87abaa3f4825a448d88a8.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/gs-lock-plug.c')
-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 ();
}