diagnose_invalid_index_path: use strbuf to avoid strcpy/strcat
commit43bb66ae0b2f1e379b73e3f0f697ca0d93e2a57b
authorJeff King <peff@peff.net>
Thu, 24 Sep 2015 21:07:52 +0000 (24 17:07 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 5 Oct 2015 18:08:05 +0000 (5 11:08 -0700)
tree086b2475b91e4ce03ccdc5885bb602f729f724e3
parentd4b3d11a03c5733a37656ca2f23171be6efad7d3
diagnose_invalid_index_path: use strbuf to avoid strcpy/strcat

We dynamically allocate a buffer and then strcpy and strcat
into it. This isn't buggy, but we'd prefer to avoid these
suspicious functions.

This would be a good candidate for converstion to xstrfmt,
but we need to record the length for dealing with index
entries. A strbuf handles that for us.

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
sha1_name.c