diff options
| author | Junio C Hamano <gitster@pobox.com> | 2016-07-19 13:22:22 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2016-07-19 13:22:22 -0700 |
| commit | 96e08010ee5b9d1dbfbcc8561fa69f972a415a38 (patch) | |
| tree | 03768d6b32e30959c8c587fcd73ca3c1da8ae275 /walker.c | |
| parent | Merge branch 'rs/help-c-source-with-gitattributes' (diff) | |
| parent | commit.c: remove print_commit_list() (diff) | |
| download | git-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.c | 10 |
1 files changed, 7 insertions, 3 deletions
@@ -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) |
