state: convert to strequal()

parent 337d6562
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment