fsmonitor: use internal argv_array of struct child_process
commit735e4173b3feba0cc495bbb2dd85341b6378f628
authorRené Scharfe <l.s.r@web.de>
Sat, 19 May 2018 08:27:46 +0000 (19 10:27 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 21 May 2018 00:58:56 +0000 (21 09:58 +0900)
tree254110f834da6b030ca1e0b0a7490f76c040276d
parentd50b69b868d1b6a7f36e94382c74d2e8cda2d64a
fsmonitor: use internal argv_array of struct child_process

Avoid magic array sizes and indexes by constructing the fsmonitor
command line using the embedded argv_array of the child_process.  The
resulting code is shorter and easier to extend.

Getting rid of the snprintf() calls is a bonus -- even though the
buffers were big enough here to avoid truncation -- as it makes auditing
the remaining callers easier.

Inspired-by: Jeff King <peff@peff.net>
Signed-off-by: Rene Scharfe <l.s.r@web.de>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
fsmonitor.c