From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Thomas Haller <thaller@redhat.com>
Cc: NetFilter <netfilter-devel@vger.kernel.org>
Subject: Re: [nft PATCH 1/2] meta: don't assume time_t is 64 bit in date_type_print()
Date: Tue, 22 Aug 2023 11:06:35 +0200 [thread overview]
Message-ID: <ZOR6myDOceCfSQ0u@calendula> (raw)
In-Reply-To: <20230822081318.1370371-1-thaller@redhat.com>
On Tue, Aug 22, 2023 at 10:13:09AM +0200, Thomas Haller wrote:
> diff --git a/src/meta.c b/src/meta.c
> index 822c2fd12b6f..0d4ae0261ff2 100644
> --- a/src/meta.c
> +++ b/src/meta.c
> @@ -385,20 +385,23 @@ const struct datatype ifname_type = {
>
> static void date_type_print(const struct expr *expr, struct output_ctx *octx)
> {
> - uint64_t tstamp = mpz_get_uint64(expr->value);
> + uint64_t tstamp64 = mpz_get_uint64(expr->value);
> + time_t tstamp;
> struct tm *tm, *cur_tm;
> char timestr[21];
For the record: I made this edit before applying:
uint64_t tstamp64 = mpz_get_uint64(expr->value);
struct tm *tm, *cur_tm;
char timestr[21];
time_t tstamp;
following reverse xmas tree layout, it is a comestic coding style
issue.
Not all the codebase follows this approach, but this is usually
preferred.
Thanks.
prev parent reply other threads:[~2023-08-22 9:06 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-08-22 8:13 [nft PATCH 1/2] meta: don't assume time_t is 64 bit in date_type_print() Thomas Haller
2023-08-22 8:13 ` [nft PATCH 2/2] meta: use reentrant localtime_r()/gmtime_r() functions Thomas Haller
2023-08-22 8:54 ` Pablo Neira Ayuso
2023-08-22 11:39 ` Thomas Haller
2023-08-22 15:15 ` Thomas Haller
2023-08-22 16:06 ` Pablo Neira Ayuso
2023-08-22 16:04 ` Pablo Neira Ayuso
2023-08-22 8:54 ` [nft PATCH 1/2] meta: don't assume time_t is 64 bit in date_type_print() Pablo Neira Ayuso
2023-08-22 9:06 ` Pablo Neira Ayuso [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ZOR6myDOceCfSQ0u@calendula \
--to=pablo@netfilter.org \
--cc=netfilter-devel@vger.kernel.org \
--cc=thaller@redhat.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).