diff options
author | Jeff King <peff@peff.net> | 2015-09-24 17:08:14 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2015-10-05 11:08:05 -0700 |
commit | b26cb7c777f8fcca5ec26cc6a7f9eba85378104f (patch) | |
tree | 383f961c9a425f0adc42ea5317484172664821e3 /pack-revindex.h | |
parent | avoid sprintf and strcpy with flex arrays (diff) | |
download | tgif-b26cb7c777f8fcca5ec26cc6a7f9eba85378104f.tar.xz |
receive-pack: simplify keep_arg computation
To generate "--keep=receive-pack $pid on $host", we write
progressively into a single buffer, which requires keeping
track of how much we've written so far. But since the result
is destined to go into our argv array, we can simply use
argv_array_pushf.
Unfortunately we still have to have a fixed-size buffer for
the gethostname() call, but at least it now doesn't involve
any extra size computation. And as a bonus, we drop an
sprintf and a strcpy call.
Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'pack-revindex.h')
0 files changed, 0 insertions, 0 deletions