[Geany-Devel] [geany/geany] fbce36: Improve build date conversion code
Enrico Tröger
enrico.troeger at xxxxx
Mon Mar 18 14:32:18 UTC 2013
On 17/03/13 19:38, Colomban Wendling wrote:
> Le 17/03/2013 18:00, Colomban Wendling a écrit :
>> 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.
Ahhh, it seems my brain is too much bound to Python to be able to write
C code...shame on me. Sorry.
>>> +
>>> + return g_strdup(input);
>>> +}
>>
>> Also, looks like the date var is leaked.
>
> I fixed both issues in
> https://github.com/geany/geany/commit/3291c30de570cc49a60fb270c952199a8acbc63d
Thank you for fixing my stupid mistakes.
Regards,
Enrico
--
Get my GPG key from http://www.uvena.de/pub.asc
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 198 bytes
Desc: OpenPGP digital signature
URL: <http://lists.geany.org/pipermail/devel/attachments/20130318/baad67b3/attachment.pgp>
More information about the Devel
mailing list