chiark / gitweb /
use strneq instead of strncmp
[elogind.git] / src / locale / localed.c
index bb2a3a2e5422cea56ac865052f836c80b1de11c4..fedcdfb373c83899a2fcf12357f6cf1ce233b4f6 100644 (file)
@@ -31,6 +31,7 @@
 #include "dbus-common.h"
 #include "polkit.h"
 #include "def.h"
+#include "env-util.h"
 
 #define INTERFACE                                                       \
         " <interface name=\"org.freedesktop.locale1\">\n"               \
@@ -853,7 +854,7 @@ static int convert_x11_to_vconsole(DBusConnection *connection) {
                                  * layout stripped off. */
                                 if (x > 0 &&
                                     strlen(a[1]) == x &&
-                                    strncmp(state.x11_layout, a[1], x) == 0)
+                                    strneq(state.x11_layout, a[1], x))
                                         matching = 5;
                                 else  {
                                         size_t w;