Skip to content

Commit

Permalink
namespace: convert to strequal()
Browse files Browse the repository at this point in the history
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
  • Loading branch information
Christian Brauner committed Feb 13, 2021
1 parent dc2c262 commit c92bfdb
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/lxc/namespace.c
Expand Up @@ -62,11 +62,10 @@ int lxc_namespace_2_cloneflag(const char *namespace)

int lxc_namespace_2_ns_idx(const char *namespace)
{
int i;

for (i = 0; i < LXC_NS_MAX; i++)
if (!strcmp(ns_info[i].proc_name, namespace))
for (int i = 0; i < LXC_NS_MAX; i++) {
if (strequal(ns_info[i].proc_name, namespace))
return i;
}

ERROR("Invalid namespace name \"%s\"", namespace);
return -EINVAL;
Expand Down

0 comments on commit c92bfdb

Please sign in to comment.