diff options
author | Phil Sutter <phil@nwl.cc> | 2018-09-19 15:16:52 +0200 |
---|---|---|
committer | Florian Westphal <fw@strlen.de> | 2018-09-24 11:24:04 +0200 |
commit | 6b7145fa2112e257073cc44346e9891fa23ce9c2 (patch) | |
tree | 2d7f5f1d256d6b3f29c6bd2b7dda2f2917c897a2 /extensions | |
parent | 749d3c2ecd6a9dc21f5a442c44495cb705621dff (diff) |
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 <phil@nwl.cc>
Signed-off-by: Florian Westphal <fw@strlen.de>
Diffstat (limited to 'extensions')
-rw-r--r-- | extensions/libxt_time.c | 8 |
1 files changed, 4 insertions, 4 deletions
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); |