Follow clang-tidy and clazy suggestions

variables non-POD should not be 'static' outside a class. Always use and init variables. Delete useless classes.
This commit is contained in:
Bruno
2021-07-17 16:45:01 +02:00
parent 5930b0f8fe
commit a18fd3177c
27 changed files with 112 additions and 174 deletions

View File

@@ -99,8 +99,7 @@ void add_interface(int fd, const char *name) {
strncpy(ifreq.ifr_name, name, IFNAMSIZ);
if(ioctl(fd, SIOCGIFADDR, &ifreq)==0) {
char host[128];
int family;
switch(family=ifreq.ifr_addr.sa_family) {
switch(ifreq.ifr_addr.sa_family) {
case AF_INET:
case AF_INET6:
getnameinfo(&ifreq.ifr_addr, sizeof ifreq.ifr_addr, host, sizeof host, 0, 0, NI_NUMERICHOST);