diff options
author | Alon Bar-Lev <alon.barlev@gmail.com> | 2012-03-29 11:16:39 +0200 |
---|---|---|
committer | David Sommerseth <davids@redhat.com> | 2012-04-02 11:54:01 +0200 |
commit | 112731fcc39535ba425ac717cb0d5bd1a2a11c61 (patch) | |
tree | 03d5cbc35637b79607293caf391c5fbcd49574cd /src/openvpn | |
parent | 5cfe3d4c1897785b32565dbb59c914fac62b0ed9 (diff) | |
download | openvpn-112731fcc39535ba425ac717cb0d5bd1a2a11c61.tar.gz openvpn-112731fcc39535ba425ac717cb0d5bd1a2a11c61.tar.xz openvpn-112731fcc39535ba425ac717cb0d5bd1a2a11c61.zip |
cleanup: avoid using ~0 - generic
Use limits.h for maximum value.
Signed-off-by: Alon Bar-Lev <alon.barlev@gmail.com>
Acked-by: Gert Doering <gert@greenie.muc.de>
Signed-off-by: David Sommerseth <davids@redhat.com>
Diffstat (limited to 'src/openvpn')
-rw-r--r-- | src/openvpn/route.c | 2 | ||||
-rw-r--r-- | src/openvpn/syshead.h | 4 |
2 files changed, 5 insertions, 1 deletions
diff --git a/src/openvpn/route.c b/src/openvpn/route.c index bf7af63..a628e77 100644 --- a/src/openvpn/route.c +++ b/src/openvpn/route.c @@ -2386,7 +2386,7 @@ get_default_gateway (struct route_gateway_info *rgi) { char line[256]; int count = 0; - unsigned int lowest_metric = ~0; + unsigned int lowest_metric = UINT_MAX; in_addr_t best_gw = 0; bool found = false; while (fgets (line, sizeof (line), fp) != NULL) diff --git a/src/openvpn/syshead.h b/src/openvpn/syshead.h index e60dc44..0595b67 100644 --- a/src/openvpn/syshead.h +++ b/src/openvpn/syshead.h @@ -129,6 +129,10 @@ #include <signal.h> #endif +#ifdef HAVE_LIMITS_H +#include <limits.h> +#endif + #ifdef HAVE_STDIO_H #include <stdio.h> #endif |