From a80975497968e69b23f56bf15d346c65bec381f2 Mon Sep 17 00:00:00 2001 From: Jan Engelhardt Date: Tue, 27 Jan 2009 17:39:01 +0100 Subject: extensions: use UINT_MAX constants over open-coded bits (1/2) ~0 depends on the sizeof(int), so it is better to use UINT32_MAX. Signed-off-by: Jan Engelhardt --- extensions/libxt_conntrack.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'extensions/libxt_conntrack.c') diff --git a/extensions/libxt_conntrack.c b/extensions/libxt_conntrack.c index d5dee7e6..532f5eee 100644 --- a/extensions/libxt_conntrack.c +++ b/extensions/libxt_conntrack.c @@ -272,7 +272,7 @@ conntrack_ps_expires(struct xt_conntrack_mtinfo1 *info, const char *s) param_act(P_BAD_VALUE, "conntrack", "--expires", s); max = min; if (*end == ':') - if (!strtonum(s, &end, &max, 0, ~0U)) + if (!strtonum(s, &end, &max, 0, UINT32_MAX)) param_act(P_BAD_VALUE, "conntrack", "--expires", s); if (*end != '\0') param_act(P_BAD_VALUE, "conntrack", "--expires", s); @@ -481,7 +481,7 @@ conntrack_mt_parse(int c, char **argv, int invert, unsigned int *flags, break; case 'a': /* --ctorigsrcport */ - if (!strtonum(optarg, NULL, &port, 0, ~(u_int16_t)0)) + if (!strtonum(optarg, NULL, &port, 0, UINT16_MAX)) param_act(P_BAD_VALUE, "conntrack", "--ctorigsrcport", optarg); info->match_flags |= XT_CONNTRACK_ORIGSRC_PORT; @@ -491,7 +491,7 @@ conntrack_mt_parse(int c, char **argv, int invert, unsigned int *flags, break; case 'b': /* --ctorigdstport */ - if (!strtonum(optarg, NULL, &port, 0, ~(u_int16_t)0)) + if (!strtonum(optarg, NULL, &port, 0, UINT16_MAX)) param_act(P_BAD_VALUE, "conntrack", "--ctorigdstport", optarg); info->match_flags |= XT_CONNTRACK_ORIGDST_PORT; @@ -501,7 +501,7 @@ conntrack_mt_parse(int c, char **argv, int invert, unsigned int *flags, break; case 'c': /* --ctreplsrcport */ - if (!strtonum(optarg, NULL, &port, 0, ~(u_int16_t)0)) + if (!strtonum(optarg, NULL, &port, 0, UINT16_MAX)) param_act(P_BAD_VALUE, "conntrack", "--ctreplsrcport", optarg); info->match_flags |= XT_CONNTRACK_REPLSRC_PORT; @@ -511,7 +511,7 @@ conntrack_mt_parse(int c, char **argv, int invert, unsigned int *flags, break; case 'd': /* --ctrepldstport */ - if (!strtonum(optarg, NULL, &port, 0, ~(u_int16_t)0)) + if (!strtonum(optarg, NULL, &port, 0, UINT16_MAX)) param_act(P_BAD_VALUE, "conntrack", "--ctrepldstport", optarg); info->match_flags |= XT_CONNTRACK_REPLDST_PORT; -- cgit v1.2.3