[PATCH v2] ui-snapshot.c: Terminate cgit_snapshot_formats[] properly
Lukas Fleischer
cgit at cryptocrack.de
Mon Mar 4 00:51:27 CET 2013
According to section 6.7.8 of the C89/C99 standards, initializer lists
must not be empty. Explicitly set the first field to zero which is the
standard way of initializing a structure to all zeros.
This also fixes a GCC warning seen with "-Wmissing-field-initializers".
Signed-off-by: Lukas Fleischer <cgit at cryptocrack.de>
---
Add a better commit message, see discussion on the original patch.
ui-snapshot.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/ui-snapshot.c b/ui-snapshot.c
index 47432bd..e740645 100644
--- a/ui-snapshot.c
+++ b/ui-snapshot.c
@@ -48,7 +48,7 @@ const struct cgit_snapshot_format cgit_snapshot_formats[] = {
{ ".tar.bz2", "application/x-bzip2", write_tar_bzip2_archive, 0x04 },
{ ".tar", "application/x-tar", write_tar_archive, 0x08 },
{ ".tar.xz", "application/x-xz", write_tar_xz_archive, 0x10 },
- {}
+ { 0 }
};
static const struct cgit_snapshot_format *get_format(const char *filename)
--
1.8.2.rc0.247.g811e0c0
More information about the CGit
mailing list