]> git.proxmox.com Git - mirror_lxc.git/commitdiff
state: convert to strequal()
authorChristian Brauner <christian.brauner@ubuntu.com>
Sat, 13 Feb 2021 20:28:46 +0000 (21:28 +0100)
committerChristian Brauner <christian.brauner@ubuntu.com>
Sat, 13 Feb 2021 20:40:27 +0000 (21:40 +0100)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/state.c

index d131e2ebebb215e95abbb587766dbdf24f8e0098..b4345e5a4a43529ea0f56805321248fde091e82f 100644 (file)
@@ -43,11 +43,12 @@ const char *lxc_state2str(lxc_state_t state)
 lxc_state_t lxc_str2state(const char *state)
 {
        size_t len;
-       lxc_state_t i;
-       len = sizeof(strstate)/sizeof(strstate[0]);
-       for (i = 0; i < len; i++)
-               if (!strcmp(strstate[i], state))
+
+       len = sizeof(strstate) / sizeof(strstate[0]);
+       for (lxc_state_t i = 0; i < len; i++) {
+               if (strequal(strstate[i], state))
                        return i;
+       }
 
        ERROR("invalid state '%s'", state);
        return -1;