aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCharles Kerr <charles.kerr@canonical.com>2012-06-19 12:27:29 -0500
committerCharles Kerr <charles.kerr@canonical.com>2012-06-19 12:27:29 -0500
commit24dafdfb3be71c4aba1c5954acfe652b79e190a3 (patch)
tree2fd046efc8f207aee531555acaf891b0c71bc576
parente19572fc77c5b80144bdbbcf9040b5a66eb4fa37 (diff)
downloadayatana-indicator-session-24dafdfb3be71c4aba1c5954acfe652b79e190a3.tar.gz
ayatana-indicator-session-24dafdfb3be71c4aba1c5954acfe652b79e190a3.tar.bz2
ayatana-indicator-session-24dafdfb3be71c4aba1c5954acfe652b79e190a3.zip
Use "g_str_has_prefix(str,foo)" instead of "strlen(str)>N && !memcmp(str,foo,N)"
-rw-r--r--src/users-service-dbus.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/users-service-dbus.c b/src/users-service-dbus.c
index 8a050fc..0191e6d 100644
--- a/src/users-service-dbus.c
+++ b/src/users-service-dbus.c
@@ -26,7 +26,6 @@
#include <glib.h>
#include <errno.h>
-#include <string.h>
#include <pwd.h> /* getpwuid() */
@@ -805,7 +804,7 @@ is_guest_username (const char * username)
if (!g_strcmp0 (username, "guest"))
return TRUE;
- if (username && (strlen(username)==12) && !memcmp(username,"guest-",6))
+ if (username && g_str_has_prefix (username, "guest-"))
return TRUE;
return FALSE;