From 28bea9e53481fddcb12e63d8c049f0ff2917a573 Mon Sep 17 00:00:00 2001 From: Tarmigan Casebolt Date: Sat, 14 Nov 2009 13:33:13 -0800 Subject: Check the format of more printf-type functions We already have these checks in many printf-type functions that have prototypes which are in header files. Add these same checks to some more prototypes in header functions and to static functions in .c files. cc: Miklos Vajna Signed-off-by: Tarmigan Casebolt Signed-off-by: Junio C Hamano --- merge-recursive.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'merge-recursive.c') diff --git a/merge-recursive.c b/merge-recursive.c index f55b7ebe11..baabe2c356 100644 --- a/merge-recursive.c +++ b/merge-recursive.c @@ -86,6 +86,7 @@ static void flush_output(struct merge_options *o) } } +__attribute__((format (printf, 3, 4))) static void output(struct merge_options *o, int v, const char *fmt, ...) { int len; @@ -214,7 +215,8 @@ struct tree *write_tree_from_memory(struct merge_options *o) for (i = 0; i < active_nr; i++) { struct cache_entry *ce = active_cache[i]; if (ce_stage(ce)) - output(o, 0, "%d %.*s", ce_stage(ce), ce_namelen(ce), ce->name); + output(o, 0, "%d %.*s", ce_stage(ce), + (int)ce_namelen(ce), ce->name); } return NULL; } -- cgit v1.2.3