[Geany-Devel] [geany/geany] fbce36: Improve build date conversion code

Colomban Wendling lists.ban at xxxxx
Sun Mar 17 17:00:49 UTC 2013


Le 17/03/2013 17:17, Enrico Tröger a écrit :
> Branch:      refs/heads/master
> Author:      Enrico Tröger <enrico.troeger at uvena.de>
> Committer:   Enrico Tröger <enrico.troeger at uvena.de>
> Date:        Sun, 17 Mar 2013 16:17:09 UTC
> Commit:      fbce36418256cacee6d52e535e8ee41bfc76db39
>              https://github.com/geany/geany/commit/fbce36418256cacee6d52e535e8ee41bfc76db39
> 
> Log Message:
> -----------
> Improve build date conversion code
> 
> Don't use strptime() as it is not very portable, instead use a GDate and use the
> code also for the date output in --version.
> 
> 
> [...]
> +gchar *utils_parse_and_format_build_date(const gchar *input)
> +{
> +	gchar date_buf[255];
> +	GDate *date = utils_parse_date(input);
> +
> +	if (date != NULL)
> +		g_date_strftime(date_buf, sizeof(date_buf), GEANY_TEMPLATES_FORMAT_DATE, date);
> +		return g_strdup(date_buf);

Missing braces around if body.  This may be the source of the bug I'm
reporting in the other mail.

> +
> +	return g_strdup(input);
> +}

Also, looks like the date var is leaked.


More information about the Devel mailing list