Re: [PATCH] cli: fix stupid aliasing bug



On Saturday 28 of May 2011 11:55:21 Andreas Schwab wrote:
> ---
>  cli/src/connections.c |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
> 
> diff --git a/cli/src/connections.c b/cli/src/connections.c
> index 2646aa9..a0b6c17 100644
> --- a/cli/src/connections.c
> +++ b/cli/src/connections.c
> @@ -400,6 +400,7 @@ show_connection (NMConnection *data, gpointer
> user_data) NmCli *nmc = (NmCli *) user_data;
>  	NMSettingConnection *s_con;
>  	guint64 timestamp;
> +	time_t timestamp_real;
>  	char *timestamp_str;
>  	char timestamp_real_str[64];
> 
> @@ -408,7 +409,8 @@ show_connection (NMConnection *data, gpointer
> user_data) /* Obtain field values */
>  		timestamp = nm_setting_connection_get_timestamp (s_con);
>  		timestamp_str = g_strdup_printf ("%" G_GUINT64_FORMAT, timestamp);
> -		strftime (timestamp_real_str, sizeof (timestamp_real_str), "%c",
> localtime ((time_t *) &timestamp)); +		timestamp_real = timestamp;
> +		strftime (timestamp_real_str, sizeof (timestamp_real_str), "%c",
> localtime (&timestamp_real));
> 
>  		nmc->allowed_fields[0].value = nm_setting_connection_get_id (s_con);
>  		nmc->allowed_fields[1].value = nm_setting_connection_get_uuid 
(s_con);

Pushed:
6780818974093802f45feb391e894bef6a879221 (master)
bb7f87e5cf138a30cf94e405bdfea44c1aeedfd4   (0.8.x)

Thanks!
Jirka


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