Re: [nft PATCH 1/2] meta: don't assume time_t is 64 bit in date_type_print()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.



[Index of Archives]     [Netfitler Users]     [Berkeley Packet Filter]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux