[PATCH] pretty: initialize new cmt_fmt_map to 0

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Without this change, is_alias is likely to happen to be nonzero,
resulting in "fatal: invalid --pretty format" when the fake alias
cannot be resolved.

Use memset instead of initializing the members one by one to make it
easier to expand the struct in the future if needed.

t4205 (log --pretty) does not pass for me without this fix.

Cc: Will Palmer <wmpalmer@xxxxxxxxx>
Signed-off-by: Jonathan Nieder <jrnieder@xxxxxxxxx>
---
Sorry I missed this before.  Sane?

Jonathan

 pretty.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/pretty.c b/pretty.c
index aaf8020..4784f67 100644
--- a/pretty.c
+++ b/pretty.c
@@ -59,6 +59,7 @@ static int git_pretty_formats_config(const char *var, const char *value, void *c
 		ALLOC_GROW(commit_formats, commit_formats_len+1,
 			   commit_formats_alloc);
 		commit_format = &commit_formats[commit_formats_len];
+		memset(commit_format, 0, sizeof(*commit_format));
 		commit_formats_len++;
 	}
 
-- 
1.7.1

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]