This started by cleaning up some unchecked snprintf() calls, but grew a few related cleanups nearby. I doubt the snprintf truncation affected anybody in practice, but I think the result is nicer to read. [1/6]: index-pack: factor out pack/idx finalization [2/6]: move odb_* declarations out of git-compat-util.h [3/6]: sha1_file.c: make pack-name helper globally accessible [4/6]: index-pack: drop fixed-size buffer for pack filenames [5/6]: fast-import: replace fixed buffer with odb_pack_name [6/6]: odb_pack_keep(): stop generating keepfile name builtin/index-pack.c | 48 +++++++++++++++++++++--------------------------- cache.h | 21 +++++++++++++++++++++ environment.c | 6 ++---- fast-import.c | 26 +++++++++++++------------- git-compat-util.h | 2 -- sha1_file.c | 17 ++++++----------- 6 files changed, 63 insertions(+), 57 deletions(-) -Peff