state: convert to strequal()

parent 337d6562
...@@ -43,11 +43,12 @@ const char *lxc_state2str(lxc_state_t state) ...@@ -43,11 +43,12 @@ const char *lxc_state2str(lxc_state_t state)
lxc_state_t lxc_str2state(const char *state) lxc_state_t lxc_str2state(const char *state)
{ {
size_t len; size_t len;
lxc_state_t i;
len = sizeof(strstate)/sizeof(strstate[0]); len = sizeof(strstate) / sizeof(strstate[0]);
for (i = 0; i < len; i++) for (lxc_state_t i = 0; i < len; i++) {
if (!strcmp(strstate[i], state)) if (strequal(strstate[i], state))
return i; return i;
}
ERROR("invalid state '%s'", state); ERROR("invalid state '%s'", state);
return -1; 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