summaryrefslogtreecommitdiff
path: root/builtin/receive-pack.c
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-06-18 20:02:13 (GMT)
committerJunio C Hamano <gitster@pobox.com>2014-06-19 19:25:17 (GMT)
commitfa3f60b783b42e0d07c667a8f582c3df12791cec (patch)
treefab9253df02e858467cf98ede8c1bebfe75be11e /builtin/receive-pack.c
parent30a0ddb705678d512185e359831479a6b3567147 (diff)
downloadgit-fa3f60b783b42e0d07c667a8f582c3df12791cec.zip
git-fa3f60b783b42e0d07c667a8f582c3df12791cec.tar.gz
git-fa3f60b783b42e0d07c667a8f582c3df12791cec.tar.bz2
use xstrfmt in favor of manual size calculations
In many parts of the code, we do an ugly and error-prone malloc like: const char *fmt = "something %s"; buf = xmalloc(strlen(foo) + 10 + 1); sprintf(buf, fmt, foo); This makes the code brittle, and if we ever get the allocation wrong, is a potential heap overflow. Let's instead favor xstrfmt, which handles the allocation automatically, and makes the code shorter and more readable. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/receive-pack.c')
0 files changed, 0 insertions, 0 deletions