From 6b7145fa2112e257073cc44346e9891fa23ce9c2 Mon Sep 17 00:00:00 2001 From: Phil Sutter Date: Wed, 19 Sep 2018 15:16:52 +0200 Subject: libxt_time: Drop initialization of variable 'year' The variable is not read before being assigned the return value of strtoul(), thefore the initialization is useless. And since after this change parameter 'end' becomes unused, drop it as well. Signed-off-by: Phil Sutter Signed-off-by: Florian Westphal --- extensions/libxt_time.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'extensions') diff --git a/extensions/libxt_time.c b/extensions/libxt_time.c index 9c5bda88..5a8cc5de 100644 --- a/extensions/libxt_time.c +++ b/extensions/libxt_time.c @@ -88,10 +88,10 @@ static void time_init(struct xt_entry_match *m) info->date_stop = INT_MAX; } -static time_t time_parse_date(const char *s, bool end) +static time_t time_parse_date(const char *s) { unsigned int month = 1, day = 1, hour = 0, minute = 0, second = 0; - unsigned int year = end ? 2038 : 1970; + unsigned int year; const char *os = s; struct tm tm; time_t ret; @@ -265,10 +265,10 @@ static void time_parse(struct xt_option_call *cb) xtables_option_parse(cb); switch (cb->entry->id) { case O_DATE_START: - info->date_start = time_parse_date(cb->arg, false); + info->date_start = time_parse_date(cb->arg); break; case O_DATE_STOP: - info->date_stop = time_parse_date(cb->arg, true); + info->date_stop = time_parse_date(cb->arg); break; case O_TIME_START: info->daytime_start = time_parse_minutes(cb->arg); -- cgit v1.2.3