]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
confile_utils: convert to strequal()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 13 Feb 2021 20:34:33 +0000 (21:34 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 13 Feb 2021 20:41:19 +0000 (21:41 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/confile_utils.c

index e8f6dbb1fdf184457422ed481f13889dbc30289a..cb79167ec9f87a8fb370b303b7a570a606fd45c3 100644 (file)
@@ -712,18 +712,18 @@ bool lxc_config_net_is_hwaddr(const char *line)
        unsigned index;
        char tmp[7];
 
-       if (strncmp(line, "lxc.net", 7) != 0)
+       if (!strnequal(line, "lxc.net", 7))
                return false;
 
-       if (strncmp(line, "lxc.net.hwaddr", 14) == 0)
+       if (strnequal(line, "lxc.net.hwaddr", 14))
                return true;
 
-       if (strncmp(line, "lxc.network.hwaddr", 18) == 0)
+       if (strnequal(line, "lxc.network.hwaddr", 18))
                return true;
 
        if (sscanf(line, "lxc.net.%u.%6s", &index, tmp) == 2 ||
            sscanf(line, "lxc.network.%u.%6s", &index, tmp) == 2)
-               return strncmp(tmp, "hwaddr", 6) == 0;
+               return strnequal(tmp, "hwaddr", 6);
 
        return false;
 }