mirror of
https://git.proxmox.com/git/mirror_lxc
synced 2025-08-02 18:56:26 +00:00
cmd: Reduce scope of 'count' variable
Variable is used in one plaice only within a nested statement block. The code is cleaner if the variable is declared near where it is used. Found using cppcheck. Reduce the scope of 'count' variable. Signed-off-by: Tobin C. Harding <me@tobin.cc>
This commit is contained in:
parent
ba464e9b66
commit
aac44dc4ff
@ -707,7 +707,6 @@ static char *get_nic_if_avail(int fd, struct alloted_s *names, int pid,
|
||||
char nicname[IFNAMSIZ];
|
||||
struct stat sb;
|
||||
struct alloted_s *n;
|
||||
int count = 0;
|
||||
char *buf = NULL;
|
||||
|
||||
for (n = names; n != NULL; n = n->next)
|
||||
@ -735,6 +734,8 @@ static char *get_nic_if_avail(int fd, struct alloted_s *names, int pid,
|
||||
owner = NULL;
|
||||
|
||||
for (n = names; n != NULL; n = n->next) {
|
||||
int count;
|
||||
|
||||
count = count_entries(buf, sb.st_size, n->name, intype, br);
|
||||
if (count >= n->allowed)
|
||||
continue;
|
||||
|
Loading…
Reference in New Issue
Block a user