mate-desktop / mate-screensaver

MATE screen saver and locker
https://mate-desktop.org
GNU General Public License v2.0
48 stars 40 forks source link

Bug Fix: g_get_real_name will never return NULL pointer #119

Closed hao-lee closed 7 years ago

hao-lee commented 7 years ago

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.

XRevan86 commented 7 years ago

I'd do it like this:

-   if (name == NULL || strcmp (name, "Unknown") == 0)
+   if (name == NULL || g_strcmp0 (name, "") == 0 ||
+           g_strcmp0 (name, "Unknown") == 0)
hao-lee commented 7 years ago

@XRevan86 Yeah, this way could handle all possible results. :smile:

raveit65 commented 7 years ago

merged https://github.com/mate-desktop/mate-screensaver/commit/14db5d0087d5b519adb87abaa3f4825a448d88a8 Thank you

hao-lee commented 7 years ago

All right. I fetch the latest commits and find this line has been changed....The reaction is so fast...