---
 src/lib/util.c |   11 +++++------
 1 file changed, 5 insertions(+), 6 deletions(-)

diff --git a/src/lib/util.c b/src/lib/util.c
index 61ce5df..febb676 100644
--- a/src/lib/util.c
+++ b/src/lib/util.c
@@ -383,12 +383,11 @@ int get_netaddr(const char *ip_str, void *ip)
 
 static inline int max_netmask(int family)
 {
-       if (family == AF_INET)
-               return 32;
-       else if (family == AF_INET6)
-               return 128;
-       else
-               return -1;
+       switch (family) {
+       case AF_INET:   return 32;
+       case AF_INET6:  return 128;
+       default:        return -1;
+       }
 }
 
 /* Check and "canonicalize" an IP address with optional netmask
-- 
1.7.9.5

_______________________________________________
Devel mailing list
[email protected]
https://lists.openvz.org/mailman/listinfo/devel

Reply via email to