]> git.ipfire.org Git - thirdparty/lxc.git/commitdiff
lxc_user_nic: cleanup get_alloted()
authorChristian Brauner <christian.brauner@ubuntu.com>
Wed, 31 Mar 2021 13:59:54 +0000 (15:59 +0200)
committerChristian Brauner <christian.brauner@ubuntu.com>
Thu, 1 Apr 2021 08:27:40 +0000 (10:27 +0200)
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
src/lxc/cmd/lxc_user_nic.c

index d8ce1a8421000f656a6c3fde8f7323c724da580f..6ead30b64383f1d3ebcdcd06cc4e318c6105ca13 100644 (file)
@@ -318,10 +318,10 @@ static int get_alloted(char *me, char *intype, char *link,
                if (ret != 4)
                        continue;
 
-               if (strlen(name) == 0)
+               if (is_empty_string(name))
                        continue;
 
-               if (strcmp(name, me)) {
+               if (!strequal(name, me)) {
                        if (name[0] != '@')
                                continue;
 
@@ -329,17 +329,17 @@ static int get_alloted(char *me, char *intype, char *link,
                                continue;
                }
 
-               if (strcmp(type, intype))
+               if (!strequal(type, intype))
                        continue;
 
-               if (strcmp(link, br))
+               if (!strequal(link, br))
                        continue;
 
-               /* Found the user or group with the appropriate settings,
-                * therefore finish the search. What to do if there are more
-                * than one applicable lines? not specified in the docs. Since
-                * getline is implemented with realloc, we don't need to free
-                * line until exiting func.
+               /*
+                * Found the user or group with the appropriate settings,
+                * therefore finish the search. What to do if there are is more
+                * than one applicable line? Currently this is not specified in
+                * the docs.
                 *
                 * If append_alloted returns NULL, e.g. due to a malloc error,
                 * we set count to 0 and break the loop, allowing cleanup and