diff options
author | Dan Nicholson <nicholson@endlessm.com> | 2019-06-19 13:08:40 -0500 |
---|---|---|
committer | Dan Nicholson <nicholson@endlessm.com> | 2020-01-24 13:02:09 -0700 |
commit | c54a3b5daa82c2bb791f061a54cdfd685f3f22be (patch) | |
tree | 077a0aa46167581b4ae5ca174afdc8356ed859e3 /src/libostree/ostree-gpg-verify-result.c | |
parent | 8cc81126a1254cda340f2ab145eb8247bad3ce35 (diff) | |
download | ostree-c54a3b5daa82c2bb791f061a54cdfd685f3f22be.tar.gz |
lib/gpg: Prefer declare-and-initialize style
As noted in
https://github.com/ostreedev/ostree/pull/1872#discussion_r295408768.
Diffstat (limited to 'src/libostree/ostree-gpg-verify-result.c')
-rw-r--r-- | src/libostree/ostree-gpg-verify-result.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/src/libostree/ostree-gpg-verify-result.c b/src/libostree/ostree-gpg-verify-result.c index d4d1cef6..63c3394a 100644 --- a/src/libostree/ostree-gpg-verify-result.c +++ b/src/libostree/ostree-gpg-verify-result.c @@ -548,14 +548,10 @@ append_expire_info (GString *output_buffer, gint64 exp_timestamp, gboolean expired) { - g_autoptr(GDateTime) date_time_utc = NULL; - g_autoptr(GDateTime) date_time_local = NULL; - g_autofree char *formatted_date_time = NULL; - if (line_prefix != NULL) g_string_append (output_buffer, line_prefix); - date_time_utc = g_date_time_new_from_unix_utc (exp_timestamp); + g_autoptr(GDateTime) date_time_utc = g_date_time_new_from_unix_utc (exp_timestamp); if (date_time_utc == NULL) { g_string_append_printf (output_buffer, @@ -565,8 +561,8 @@ append_expire_info (GString *output_buffer, return; } - date_time_local = g_date_time_to_local (date_time_utc); - formatted_date_time = g_date_time_format (date_time_local, "%c"); + g_autoptr(GDateTime) date_time_local = g_date_time_to_local (date_time_utc); + g_autofree char *formatted_date_time = g_date_time_format (date_time_local, "%c"); if (expired) { |