diff options
author | Jeff King <peff@peff.net> | 2015-09-24 17:07:34 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-09-25 10:18:18 -0700 |
commit | ac5190cc48bd75586566ccc052304d40bbc63147 (patch) | |
tree | 2d1958c32b8395c45a9eff2b377271b2ee404f34 /compat | |
parent | 54ba4c5fa2d7de216ca090ac2e657728462c81d5 (diff) | |
download | git-ac5190cc48bd75586566ccc052304d40bbc63147.tar.gz |
sha1_get_pack_name: use a strbuf
We do some manual memory computation here, and there's no
check that our 60 is not overflowed by the raw sprintf (it
isn't, because the "which" parameter is never longer than
"pack"). We can simplify this greatly with a strbuf.
Technically the end result is not identical, as the original
took care not to rewrite the object directory on each call
for performance reasons. We could do that here, too (by
saving the baselen and resetting to it), but it's not worth
the complexity; this function is not called a lot (generally
once per packfile that we open).
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'compat')
0 files changed, 0 insertions, 0 deletions