aboutsummaryrefslogtreecommitdiffstats
path: root/walker.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-07-19 13:22:22 -0700
committerJunio C Hamano <gitster@pobox.com>2016-07-19 13:22:22 -0700
commit96e08010ee5b9d1dbfbcc8561fa69f972a415a38 (patch)
tree03768d6b32e30959c8c587fcd73ca3c1da8ae275 /walker.c
parentMerge branch 'rs/help-c-source-with-gitattributes' (diff)
parentcommit.c: remove print_commit_list() (diff)
downloadgit-96e08010ee5b9d1dbfbcc8561fa69f972a415a38.tar.gz
git-96e08010ee5b9d1dbfbcc8561fa69f972a415a38.zip
Merge branch 'jk/printf-format'
Code clean-up to avoid using a variable string that compilers may feel untrustable as printf-style format given to write_file() helper function. * jk/printf-format: commit.c: remove print_commit_list() avoid using sha1_to_hex output as printf format walker: let walker_say take arbitrary formats
Diffstat (limited to 'walker.c')
-rw-r--r--walker.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/walker.c b/walker.c
index d95b007294..2c86e406f9 100644
--- a/walker.c
+++ b/walker.c
@@ -9,10 +9,14 @@
static unsigned char current_commit_sha1[20];
-void walker_say(struct walker *walker, const char *fmt, const char *hex)
+void walker_say(struct walker *walker, const char *fmt, ...)
{
- if (walker->get_verbosely)
- fprintf(stderr, fmt, hex);
+ if (walker->get_verbosely) {
+ va_list ap;
+ va_start(ap, fmt);
+ vfprintf(stderr, fmt, ap);
+ va_end(ap);
+ }
}
static void report_missing(const struct object *obj)