History

ui-snapshot: set unused cgit_filter fields to zero

By switching the assignment of fields in the cgit_filter structure to use designated initializers, the compiler will initialize all other fields to their default value. This will be needed when we add the extra_args field in the next patch.

John Keeping committed 12 years ago

Commit da218fc1 parent fd31aa61 file · +4 −4Browse files

Unified · Split

ui-snapshot.c+4−4
@@ -58,10 +58,10 @@ static int write_compressed_tar_archive(const char *hex, · 57 unmodified lines
5858 char *filter_argv[])
5959 {
6060 int rv;
61− struct cgit_filter f;
62−
63− f.cmd = filter_argv[0];
64− f.argv = filter_argv;
61+ struct cgit_filter f = {
62+ .cmd = filter_argv[0],
63+ .argv = filter_argv,
64+ };
6565 cgit_open_filter(&f);
6666 rv = write_tar_archive(hex, prefix);
6767 cgit_close_filter(&f);