Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJeff King <peff@peff.net>2014-06-19 00:02:13 +0400
committerJunio C Hamano <gitster@pobox.com>2014-06-19 23:25:17 +0400
commitfa3f60b783b42e0d07c667a8f582c3df12791cec (patch)
treefab9253df02e858467cf98ede8c1bebfe75be11e /http-walker.c
parent30a0ddb705678d512185e359831479a6b3567147 (diff)
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 'http-walker.c')
0 files changed, 0 insertions, 0 deletions